function CheckTokenMembership(TokenHandle: HANDLE; SidToCheck: PSID; var IsMember: BOOL): BOOL; stdcall; external advapi32;
{%ENDREGION}
{%REGION Filesystem }
@@ -75,7 +83,6 @@ const
{%ENDREGION}
{%REGION ShellAPI }
{$if FPC_FULLVERSION < 030101}
// only needed in versions where 0029036 is not fixed (before r32452)
@@ -87,6 +94,29 @@ function SHOpenFolderAndSelectItems(pidlFolder:LPCITEMIDLIST;cidl:UINT; apidl:
// FIXME: temporary until 0028760 is fixed in FPC
function SHBindToParent2(pidl:LPCITEMIDLIST; constref riid:TREFIID; var ppv:Pointer; var ppidlLast:LPCITEMIDLIST):HRESULT;StdCall;external External_library name 'SHBindToParent';
type
PHICON = ^HICON;
function ExtractIconEx(lpszFile: LPCSTR; nIconIndex: Integer; phIconLarge, phIconSmall: PHICON; nIcons: UINT):UINT; external shell32 name 'ExtractIconExA';
function ExtractIconExW(lpszFile: LPCWSTR; nIconIndex: Integer; phIconLarge, phIconSmall: PHICON; nIcons: UINT):UINT; external shell32 name 'ExtractIconExW';
function PathUnExpandEnvStrings(lpSrc:LPCSTR; lpDst:LPSTR; nSize:DWORD):BOOL; external shlwapi name 'PathUnExpandEnvStringsA';
{%ENDREGION}
{%REGION Helper - System }
(*
Routine Description: This routine returns TRUE if the caller's
process is a member of the Administrators local group. Caller is NOT
expected to be impersonating anyone and is expected to be able to
open its own process and process token.
Arguments: None.
Return Value:
TRUE - Caller has Administrators local group.
FALSE - Caller does not have Administrators local group. --
*)
function IsUserAdmin: BOOL;
function IsWow64: Boolean;
{%ENDREGION}
{%REGION Helper - Filesystem }
@@ -100,7 +130,7 @@ function GetFileCompressedSize(const aFileName: string; out FSize: QWord): Boole
function GetFileIndex(const aFilename: string; out FIndex: QWORD): boolean;
{%ENDREGION}
{%REGION Helpr - ShellAPI }
{%REGION Helper - ShellAPI }
function GetConfigLocation(const aPortable, aRoaming: boolean; aProgramSubdir: String): string;
function OpenFolderAndSelectFile(const FileName: string): boolean;
@@ -111,6 +141,51 @@ implementation
uses
windirs;
function IsWow64: Boolean;
type
TIsWow64Process = function( // Type of IsWow64Process API fn
Handle: Windows.THandle; var Res: Windows.BOOL
): Windows.BOOL; stdcall;
var
IsWow64Result: Windows.BOOL; // Result from IsWow64Process