reactos/dll/win32/kernel32/include/kernel32.h

485 lines
11 KiB
C
Raw Normal View History

#pragma once
//
// Kernel32 Filter IDs
//
#define kernel32file 200
#define kernel32ver 201
#define actctx 202
#define resource 203
#define kernel32session 204
#define comm 205
#define profile 206
#define nls 207
#if DBG
#define DEBUG_CHANNEL(ch) static ULONG gDebugChannel = ch;
#else
#define DEBUG_CHANNEL(ch)
#endif
#define TRACE(fmt, ...) TRACE__(gDebugChannel, fmt, ##__VA_ARGS__)
#define WARN(fmt, ...) WARN__(gDebugChannel, fmt, ##__VA_ARGS__)
#define FIXME(fmt, ...) WARN__(gDebugChannel, fmt,## __VA_ARGS__)
#define ERR(fmt, ...) ERR__(gDebugChannel, fmt, ##__VA_ARGS__)
#define STUB \
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
DPRINT1("%s() is UNIMPLEMENTED!\n", __FUNCTION__)
#define debugstr_a
[KERNEL32]: While working on the CMAKE branch, Amine and myself discovered a rather serious issue in kernel32 (and perhaps other libraries as well). Unlike rbuild, CMake does not allow you to export non-existant DLL functions (try it: add "poopyhead" in kernel32's exports under RBuild, and will it export "poopyhead", God knowing what that will actually link to). As an additional feature on top of the "allow non-existing functions to be exported" "feature", because rbuild generates and links STDCALL function names without the proper decoration (vs. enforcing decoration at linking, but only removing it at export-time), this allows the definition (as an export) of a STDCALL function that is completely different from the actual function itself. For example, the 5-parameter Foo function is normally Foo@20, while the 3-parameter Foo function woudl be Foo@12. Linking one against the other would fail (say, 2 parameters were added to Foo in a newer version). However, under RBUILD, both of these would appear as "Foo", and the linker/compiler would happilly connect the caller of Foo@3 (that has pushed 3 parameters) to the receiving side of Foo@5 (that is about to pop 5 parameters). Even -if- decorations WERE to be applied, Foo@12 would STILL succeed, because of the first feature, which would enable the export of Foo@12 even though no such function exist. In a further, bizare, twist of fate, the behavior of this RBUILD "feature", when the target function is not found, is to link the exported DLL TO ITSELF. Therefore, one can see how, previously to this patch, kernel32.dll would import a dozen functions from itself (all the non-existing functions). To really seal the deal, the behavior of exported functions used by kernel32, but that are actually forwarded to another DLL deserves a special mention. GetLastError, for example, merely forwards to RtlGetLastWin32Error, so it is normal behavior to use a #define in the C code so that all internal calls to the function are routed correctly. This did not happen, so instead, kernel32 tried importing/linking/exporting GetLastError, but this symbol is not found in the binary, because it is only a forwarder. This caused kernel32 to import from itself (the behavior when an exported symbol is not found). When importing from itself, the loader would now find the _forwarded_ for GetLastError, and correctly link with ntdll. What should be a one-liner of assembly (inline TEB access) thus became a triple-call indirection (GetLastError@0->StubLastError@0->__impGetLastError@0->__impRtlGetLastWin32Error->RtlGetLastWin32Error. While analyzing these issues, we also realized a strange macro SetLastErrorByStatus that manually tried to perform what there already exists a function for: RtlSetLastNtStatusFromWin32Error. And, in an exciting coda, we also realized that our Server 2003 Kernel32 exports more than a dozen Windows 95 APIs, through an auto-stub generation mechanism within winebuild, that gets linked as an object behind the scenes. [KERNEL32]: Removed all Win95 exports, cleaned up exports. [KERNEL32]: Fixed up set/get error macros by making them inline and/or calling the correct ntdll function. [KERNEL32]: Removed bizare calls to Wine-internal/specific APIs from our core Win32 DLL. [KERNEL32]: Wrote stubs for all functions which should be exported, and set the correct number of parameters for them. [KERNEL32]: Kernel32 is smaller, loads faster, does not export Windows 95 functions, does not export non-existing functions, and does not import from itself anymore. Note: This is one of the many failings of RBUILD the CMAKE system has helped us discover. I believe these issues are serious enough to warrant an immediate sync with trunk, but rest assured, there are many more completely broken, infinitely-regressing things that we discovered while switching to CMAKE. svn path=/trunk/; revision=48475
2010-08-07 05:02:58 +00:00
#define debugstr_w
#define debugstr_wn
#define wine_dbgstr_w
[KERNEL32]: While working on the CMAKE branch, Amine and myself discovered a rather serious issue in kernel32 (and perhaps other libraries as well). Unlike rbuild, CMake does not allow you to export non-existant DLL functions (try it: add "poopyhead" in kernel32's exports under RBuild, and will it export "poopyhead", God knowing what that will actually link to). As an additional feature on top of the "allow non-existing functions to be exported" "feature", because rbuild generates and links STDCALL function names without the proper decoration (vs. enforcing decoration at linking, but only removing it at export-time), this allows the definition (as an export) of a STDCALL function that is completely different from the actual function itself. For example, the 5-parameter Foo function is normally Foo@20, while the 3-parameter Foo function woudl be Foo@12. Linking one against the other would fail (say, 2 parameters were added to Foo in a newer version). However, under RBUILD, both of these would appear as "Foo", and the linker/compiler would happilly connect the caller of Foo@3 (that has pushed 3 parameters) to the receiving side of Foo@5 (that is about to pop 5 parameters). Even -if- decorations WERE to be applied, Foo@12 would STILL succeed, because of the first feature, which would enable the export of Foo@12 even though no such function exist. In a further, bizare, twist of fate, the behavior of this RBUILD "feature", when the target function is not found, is to link the exported DLL TO ITSELF. Therefore, one can see how, previously to this patch, kernel32.dll would import a dozen functions from itself (all the non-existing functions). To really seal the deal, the behavior of exported functions used by kernel32, but that are actually forwarded to another DLL deserves a special mention. GetLastError, for example, merely forwards to RtlGetLastWin32Error, so it is normal behavior to use a #define in the C code so that all internal calls to the function are routed correctly. This did not happen, so instead, kernel32 tried importing/linking/exporting GetLastError, but this symbol is not found in the binary, because it is only a forwarder. This caused kernel32 to import from itself (the behavior when an exported symbol is not found). When importing from itself, the loader would now find the _forwarded_ for GetLastError, and correctly link with ntdll. What should be a one-liner of assembly (inline TEB access) thus became a triple-call indirection (GetLastError@0->StubLastError@0->__impGetLastError@0->__impRtlGetLastWin32Error->RtlGetLastWin32Error. While analyzing these issues, we also realized a strange macro SetLastErrorByStatus that manually tried to perform what there already exists a function for: RtlSetLastNtStatusFromWin32Error. And, in an exciting coda, we also realized that our Server 2003 Kernel32 exports more than a dozen Windows 95 APIs, through an auto-stub generation mechanism within winebuild, that gets linked as an object behind the scenes. [KERNEL32]: Removed all Win95 exports, cleaned up exports. [KERNEL32]: Fixed up set/get error macros by making them inline and/or calling the correct ntdll function. [KERNEL32]: Removed bizare calls to Wine-internal/specific APIs from our core Win32 DLL. [KERNEL32]: Wrote stubs for all functions which should be exported, and set the correct number of parameters for them. [KERNEL32]: Kernel32 is smaller, loads faster, does not export Windows 95 functions, does not export non-existing functions, and does not import from itself anymore. Note: This is one of the many failings of RBUILD the CMAKE system has helped us discover. I believe these issues are serious enough to warrant an immediate sync with trunk, but rest assured, there are many more completely broken, infinitely-regressing things that we discovered while switching to CMAKE. svn path=/trunk/; revision=48475
2010-08-07 05:02:58 +00:00
#define debugstr_guid
#include "wine/unicode.h"
#include "baseheap.h"
#define MAGIC(c1,c2,c3,c4) ((c1) + ((c2)<<8) + ((c3)<<16) + ((c4)<<24))
#define MAGIC_HEAP MAGIC( 'H','E','A','P' )
#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
#define ROUNDDOWN(a,b) (((a)/(b))*(b))
#define ROUND_DOWN(n, align) \
(((ULONG)n) & ~((align) - 1l))
#define ROUND_UP(n, align) \
ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
#define __TRY _SEH2_TRY
#define __EXCEPT_PAGE_FAULT _SEH2_EXCEPT(_SEH2_GetExceptionCode() == STATUS_ACCESS_VIOLATION)
#define __ENDTRY _SEH2_END
/* Undocumented CreateProcess flag */
#define STARTF_SHELLPRIVATE 0x400
typedef struct _CODEPAGE_ENTRY
{
LIST_ENTRY Entry;
UINT CodePage;
HANDLE SectionHandle;
PBYTE SectionMapping;
CPTABLEINFO CodePageTable;
} CODEPAGE_ENTRY, *PCODEPAGE_ENTRY;
typedef struct tagLOADPARMS32
{
LPSTR lpEnvAddress;
LPSTR lpCmdLine;
WORD wMagicValue;
WORD wCmdShow;
DWORD dwReserved;
} LOADPARMS32;
typedef enum _BASE_SEARCH_PATH_TYPE
{
BaseSearchPathInvalid,
BaseSearchPathDll,
BaseSearchPathApp,
BaseSearchPathDefault,
BaseSearchPathEnv,
BaseSearchPathCurrent,
BaseSearchPathMax
} BASE_SEARCH_PATH_TYPE, *PBASE_SEARCH_PATH_TYPE;
typedef enum _BASE_CURRENT_DIR_PLACEMENT
{
BaseCurrentDirPlacementInvalid = -1,
BaseCurrentDirPlacementDefault,
BaseCurrentDirPlacementSafe,
BaseCurrentDirPlacementMax
} BASE_CURRENT_DIR_PLACEMENT;
typedef struct _BASEP_ACTCTX_BLOCK
{
ULONG Flags;
PVOID ActivationContext;
PVOID CompletionContext;
LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine;
} BASEP_ACTCTX_BLOCK, *PBASEP_ACTCTX_BLOCK;
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_ERROR 1
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_SUCCESS 2
#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_CONTINUE 3
extern PBASE_STATIC_SERVER_DATA BaseStaticServerData;
typedef
DWORD
(*WaitForInputIdleType)(
HANDLE hProcess,
DWORD dwMilliseconds);
[KERNEL32]: Changes to proc.c: - ReadProcessMemory/WriteProcessMemory only write to *lpNumberOfBytesRead/Written if user-mode passed in the parameter, as its an optional argument in Win32, but not in NT. Instead, use a local variable. This means that anyone calling ReadProcessMemory/WriteProcessMemory in ReactOS before with a NULL output argument (totally valid) was getting an error before! - WriteProcessMemory actually returns STATUS_ACCESS_VIOLATION in a few cases, even if it's defined as a BOOL function. Code on Google shows major applications depending on this, which we weren't doing. - Rewrite InitCommandLines to be much simpler. No normalization or copying or ANSi/OEM logic is needed. - GetProcessAffinityMask should use the BaseStaticServerData from CSRSS instead of querying system information each time. - GetProcessShutdownParameters and SetProcessShutdownParameters should use the LPC status code from CSRSS, not the LPC API status code. - GetProcessWorkingSetSize now calls GetProcessWorkingSetSizeEx. - Implement GetProcessWorkingSetSizeEx. - SetProcessWorkingSetSize now calls SetProcessWorkingSetSizeEx. - Implement SetProcessWorkingSetSizeEx. - Acquire the required privilege in SetProcessWorkingSetSize(Ex). - Fail with correct status code in SetProcessWorkingSetSize(Ex). - GetExitCodeProcess should check if this is a VDM process and get the exit code that way. - GetStartupInfoW should not fail if the input is NULL. It should crash. - GetStartupInfoW was not filling out the lpReserved field, which should contain the ShellInfo buffer. - GetStartupInfoW was always setting standard handles -- it should not do so if those are console handles. - GetStartupInfoA was not thread-safe. - GetStartupInfoA was assuming all Unicode->ANSI conversions will be successful. - GetStartupInfoA was not filling out lpReserved either. - ExitProcess was not using SEH and was not using the PEB lock. - TerminateProcess was not setting ERROR_INVALID_HANDLE last error code. - FatalAppExitA was not using static TEB buffer, and was always assuming success. - FatalAppExitW was doing some sort of bizarre hack. It now raises as a hard error as it should. - FatalExit now displays a debugger input interface on checked builds, just like Windows. - SetPriorityClass now tries to acquire the real time privilege when needed, and handles failure to do so. - GetProcessVersion rewritten to be cleaner and simpler. - Annotate and reformat functions where needed. - Rename lpfnGlobalRegisterWaitForInputIdle to UserWaitForInputIdleRoutine - GetProcessPriorityBoost is now BOOL-safe. - IsWow64Process now sets NT error code using only one API. - CommandLineStringA/W -> BaseAnsiCommandLine/BaseUnicodeCommandLine. svn path=/trunk/; revision=55092
2012-01-23 04:57:12 +00:00
extern WaitForInputIdleType UserWaitForInputIdleRoutine;
/* Flags for PrivCopyFileExW && BasepCopyFileExW */
#define BASEP_COPY_METADATA 0x10
#define BASEP_COPY_SACL 0x20
#define BASEP_COPY_OWNER_AND_GROUP 0x40
#define BASEP_COPY_DIRECTORY 0x80
#define BASEP_COPY_BACKUP_SEMANTICS 0x100
#define BASEP_COPY_REPLACE 0x200
#define BASEP_COPY_SKIP_DACL 0x400
#define BASEP_COPY_PUBLIC_MASK 0xF
#define BASEP_COPY_BASEP_MASK 0xFFFFFFF0
/* Flags for PrivMoveFileIdentityW */
#define PRIV_DELETE_ON_SUCCESS 0x1
#define PRIV_ALLOW_NON_TRACKABLE 0x2
/* GLOBAL VARIABLES **********************************************************/
extern BOOL bIsFileApiAnsi;
extern HMODULE hCurrentModule;
extern RTL_CRITICAL_SECTION BaseDllDirectoryLock;
extern UNICODE_STRING BaseDllDirectory;
extern UNICODE_STRING BaseDefaultPath;
extern UNICODE_STRING BaseDefaultPathAppend;
extern PLDR_DATA_TABLE_ENTRY BasepExeLdrEntry;
extern LPTOP_LEVEL_EXCEPTION_FILTER GlobalTopLevelExceptionFilter;
extern SYSTEM_BASIC_INFORMATION BaseCachedSysInfo;
extern BOOLEAN BaseRunningInServerProcess;
/* FUNCTION PROTOTYPES *******************************************************/
VOID
NTAPI
BaseDllInitializeMemoryManager(VOID);
PTEB GetTeb(VOID);
PWCHAR FilenameA2W(LPCSTR NameA, BOOL alloc);
DWORD FilenameW2A_N(LPSTR dest, INT destlen, LPCWSTR src, INT srclen);
DWORD FilenameW2A_FitOrFail(LPSTR DestA, INT destLen, LPCWSTR SourceW, INT sourceLen);
DWORD FilenameU2A_FitOrFail(LPSTR DestA, INT destLen, PUNICODE_STRING SourceU);
#define HeapAlloc RtlAllocateHeap
#define HeapReAlloc RtlReAllocateHeap
#define HeapFree RtlFreeHeap
#define _lread(a, b, c) (long)(_hread(a, b, (long)c))
PLARGE_INTEGER
WINAPI
BaseFormatTimeOut(OUT PLARGE_INTEGER Timeout,
IN DWORD dwMilliseconds);
POBJECT_ATTRIBUTES
WINAPI
BaseFormatObjectAttributes(OUT POBJECT_ATTRIBUTES ObjectAttributes,
IN PSECURITY_ATTRIBUTES SecurityAttributes OPTIONAL,
IN PUNICODE_STRING ObjectName);
NTSTATUS
WINAPI
BaseCreateStack(HANDLE hProcess,
SIZE_T StackReserve,
SIZE_T StackCommit,
PINITIAL_TEB InitialTeb);
VOID
WINAPI
BaseInitializeContext(IN PCONTEXT Context,
IN PVOID Parameter,
IN PVOID StartAddress,
IN PVOID StackAddress,
IN ULONG ContextType);
VOID
WINAPI
BaseThreadStartupThunk(VOID);
VOID
WINAPI
BaseProcessStartThunk(VOID);
VOID
NTAPI
BasepFreeActivationContextActivationBlock(
IN PBASEP_ACTCTX_BLOCK ActivationBlock
);
NTSTATUS
NTAPI
BasepAllocateActivationContextActivationBlock(
IN DWORD Flags,
IN PVOID CompletionRoutine,
IN PVOID CompletionContext,
OUT PBASEP_ACTCTX_BLOCK *ActivationBlock
);
NTSTATUS
NTAPI
BasepProbeForDllManifest(
IN PVOID DllHandle,
IN PCWSTR FullDllName,
OUT PVOID *ActCtx
);
__declspec(noreturn)
VOID
WINAPI
BaseThreadStartup(LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter);
VOID
WINAPI
BaseFreeThreadStack(IN HANDLE hProcess,
IN PINITIAL_TEB InitialTeb);
__declspec(noreturn)
VOID
WINAPI
BaseFiberStartup(VOID);
typedef UINT (WINAPI *PPROCESS_START_ROUTINE)(VOID);
VOID
WINAPI
BaseProcessStartup(PPROCESS_START_ROUTINE lpStartAddress);
PVOID
WINAPI
BasepIsRealtimeAllowed(IN BOOLEAN Keep);
VOID
WINAPI
BasepAnsiStringToHeapUnicodeString(IN LPCSTR AnsiString,
OUT LPWSTR* UnicodeString);
PUNICODE_STRING
WINAPI
Basep8BitStringToStaticUnicodeString(IN LPCSTR AnsiString);
BOOLEAN
WINAPI
Basep8BitStringToDynamicUnicodeString(OUT PUNICODE_STRING UnicodeString,
IN LPCSTR String);
typedef NTSTATUS (NTAPI *PRTL_CONVERT_STRING)(IN PUNICODE_STRING UnicodeString,
IN PANSI_STRING AnsiString,
IN BOOLEAN AllocateMemory);
typedef ULONG (NTAPI *PRTL_COUNT_STRING)(IN PUNICODE_STRING UnicodeString);
typedef NTSTATUS (NTAPI *PRTL_CONVERT_STRINGA)(IN PANSI_STRING AnsiString,
IN PCUNICODE_STRING UnicodeString,
IN BOOLEAN AllocateMemory);
typedef ULONG (NTAPI *PRTL_COUNT_STRINGA)(IN PANSI_STRING UnicodeString);
ULONG
NTAPI
BasepUnicodeStringToAnsiSize(IN PUNICODE_STRING String);
ULONG
NTAPI
BasepAnsiStringToUnicodeSize(IN PANSI_STRING String);
extern PRTL_CONVERT_STRING Basep8BitStringToUnicodeString;
extern PRTL_CONVERT_STRINGA BasepUnicodeStringTo8BitString;
extern PRTL_COUNT_STRING BasepUnicodeStringTo8BitSize;
extern PRTL_COUNT_STRINGA Basep8BitStringToUnicodeSize;
extern UNICODE_STRING BaseWindowsDirectory, BaseWindowsSystemDirectory;
extern HANDLE BaseNamedObjectDirectory;
HANDLE
WINAPI
BaseGetNamedObjectDirectory(VOID);
NTSTATUS
WINAPI
BasepMapFile(IN LPCWSTR lpApplicationName,
OUT PHANDLE hSection,
IN PUNICODE_STRING ApplicationName);
PCODEPAGE_ENTRY FASTCALL
IntGetCodePageEntry(UINT CodePage);
LPWSTR
WINAPI
BaseComputeProcessDllPath(
IN LPWSTR FullPath,
IN PVOID Environment
);
LPWSTR
WINAPI
BaseComputeProcessExePath(
IN LPWSTR FullPath
);
ULONG
WINAPI
BaseIsDosApplication(
IN PUNICODE_STRING PathName,
IN NTSTATUS Status
);
NTSTATUS
WINAPI
BasepCheckBadapp(
IN HANDLE FileHandle,
IN PWCHAR ApplicationName,
IN PWCHAR Environment,
IN USHORT ExeType,
IN PVOID* SdbQueryAppCompatData,
IN PULONG SdbQueryAppCompatDataSize,
IN PVOID* SxsData,
IN PULONG SxsDataSize,
OUT PULONG FusionFlags
);
BOOLEAN
WINAPI
IsShimInfrastructureDisabled(
VOID
);
VOID
WINAPI
InitCommandLines(VOID);
DWORD
WINAPI
BaseSetLastNTError(IN NTSTATUS Status);
VOID
NTAPI
BasepLocateExeLdrEntry(IN PLDR_DATA_TABLE_ENTRY Entry,
IN PVOID Context,
OUT BOOLEAN *StopEnumeration);
typedef NTSTATUS
(NTAPI *PBASEP_APPCERT_PLUGIN_FUNC)(
IN LPWSTR ApplicationName,
IN ULONG CertFlag
);
typedef NTSTATUS
(NTAPI *PBASEP_APPCERT_EMBEDDED_FUNC)(
IN LPWSTR ApplicationName
);
typedef NTSTATUS
(NTAPI *PSAFER_REPLACE_PROCESS_THREAD_TOKENS)(
IN HANDLE Token,
IN HANDLE Process,
IN HANDLE Thread
);
typedef struct _BASEP_APPCERT_ENTRY
{
LIST_ENTRY Entry;
UNICODE_STRING Name;
PBASEP_APPCERT_PLUGIN_FUNC fPluginCertFunc;
} BASEP_APPCERT_ENTRY, *PBASEP_APPCERT_ENTRY;
typedef struct _BASE_MSG_SXS_HANDLES
{
HANDLE File;
HANDLE Process;
HANDLE Section;
LARGE_INTEGER ViewBase;
} BASE_MSG_SXS_HANDLES, *PBASE_MSG_SXS_HANDLES;
typedef struct _SXS_WIN32_NT_PATH_PAIR
{
PUNICODE_STRING Win32;
PUNICODE_STRING Nt;
} SXS_WIN32_NT_PATH_PAIR, *PSXS_WIN32_NT_PATH_PAIR;
typedef struct _SXS_OVERRIDE_MANIFEST
{
PCWCH Name;
PVOID Address;
ULONG Size;
} SXS_OVERRIDE_MANIFEST, *PSXS_OVERRIDE_MANIFEST;
NTSTATUS
NTAPI
BasepConfigureAppCertDlls(
IN PWSTR ValueName,
IN ULONG ValueType,
IN PVOID ValueData,
IN ULONG ValueLength,
IN PVOID Context,
IN PVOID EntryContext
);
extern LIST_ENTRY BasepAppCertDllsList;
extern RTL_CRITICAL_SECTION gcsAppCert;
VOID
WINAPI
BaseMarkFileForDelete(
IN HANDLE FileHandle,
IN ULONG FileAttributes
);
BOOL
BasepCopyFileExW(
IN LPCWSTR lpExistingFileName,
IN LPCWSTR lpNewFileName,
IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL,
IN LPVOID lpData OPTIONAL,
IN LPBOOL pbCancel OPTIONAL,
IN DWORD dwCopyFlags,
IN DWORD dwBasepFlags,
OUT LPHANDLE lpExistingHandle,
OUT LPHANDLE lpNewHandle
);
BOOL
BasepGetVolumeNameForVolumeMountPoint(
IN LPCWSTR lpszMountPoint,
OUT LPWSTR lpszVolumeName,
IN DWORD cchBufferLength,
OUT LPBOOL IsAMountPoint
);
BOOL
BasepGetVolumeNameFromReparsePoint(
IN LPCWSTR lpszMountPoint,
OUT LPWSTR lpszVolumeName,
IN DWORD cchBufferLength,
OUT LPBOOL IsAMountPoint
);
BOOL
IsThisARootDirectory(
IN HANDLE VolumeHandle,
IN PUNICODE_STRING NtPathName
);
/* FIXME: This is EXPORTED! It should go in an external kernel32.h header */
VOID
WINAPI
BasepFreeAppCompatData(
IN PVOID AppCompatData,
IN PVOID AppCompatSxsData
);
NTSTATUS
WINAPI
BasepCheckWinSaferRestrictions(
IN HANDLE UserToken,
IN LPWSTR ApplicationName,
IN HANDLE FileHandle,
OUT PBOOLEAN InJob,
OUT PHANDLE NewToken,
OUT PHANDLE JobHandle
);