6#define kernel32file 200
10#define kernel32session 204
17#define DEBUG_CHANNEL(ch) static ULONG gDebugChannel = ch;
19#define DEBUG_CHANNEL(ch)
22#define TRACE(fmt, ...) TRACE__(gDebugChannel, fmt, ##__VA_ARGS__)
23#define WARN(fmt, ...) WARN__(gDebugChannel, fmt, ##__VA_ARGS__)
24#define FIXME(fmt, ...) WARN__(gDebugChannel, fmt,## __VA_ARGS__)
25#define ERR(fmt, ...) ERR__(gDebugChannel, fmt, ##__VA_ARGS__)
28 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
29 DPRINT1("%s() is UNIMPLEMENTED!\n", __FUNCTION__)
37#include "wine/unicode.h"
40#define MAGIC(c1,c2,c3,c4) ((c1) + ((c2)<<8) + ((c3)<<16) + ((c4)<<24))
42#define MAGIC_HEAP MAGIC( 'H','E','A','P' )
44#define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
45#define ROUNDDOWN(a,b) (((a)/(b))*(b))
47#define ROUND_DOWN(n, align) \
48 (((ULONG)n) & ~((align) - 1l))
50#define ROUND_UP(n, align) \
51 ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
53#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
55#define __TRY _SEH2_TRY
56#define __EXCEPT_PAGE_FAULT _SEH2_EXCEPT(_SEH2_GetExceptionCode() == STATUS_ACCESS_VIOLATION)
57#define __ENDTRY _SEH2_END
60#define STARTF_SHELLPRIVATE 0x400
107#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_ERROR 1
108#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_SUCCESS 2
109#define BASEP_GET_MODULE_HANDLE_EX_PARAMETER_VALIDATION_CONTINUE 3
117 DWORD dwMilliseconds);
122#define BASEP_COPY_METADATA 0x10
123#define BASEP_COPY_SACL 0x20
124#define BASEP_COPY_OWNER_AND_GROUP 0x40
125#define BASEP_COPY_DIRECTORY 0x80
126#define BASEP_COPY_BACKUP_SEMANTICS 0x100
127#define BASEP_COPY_REPLACE 0x200
128#define BASEP_COPY_SKIP_DACL 0x400
129#define BASEP_COPY_PUBLIC_MASK 0xF
130#define BASEP_COPY_BASEP_MASK 0xFFFFFFF0
133#define PRIV_DELETE_ON_SUCCESS 0x1
134#define PRIV_ALLOW_NON_TRACKABLE 0x2
168#define HeapAlloc RtlAllocateHeap
169#define HeapReAlloc RtlReAllocateHeap
170#define HeapFree RtlFreeHeap
171#define _lread(a, b, c) (long)(_hread(a, b, (long)c))
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG FileAttributes
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
_Must_inspect_result_ _Out_ PHANDLE VolumeHandle
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE ContextType
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
_In_ GUID _In_ PVOID ValueData
PWCHAR FilenameA2W(LPCSTR NameA, BOOL alloc)
struct _BASEP_APPCERT_ENTRY BASEP_APPCERT_ENTRY
PLARGE_INTEGER WINAPI BaseFormatTimeOut(OUT PLARGE_INTEGER Timeout, IN DWORD dwMilliseconds)
UNICODE_STRING BaseWindowsDirectory
NTSTATUS NTAPI BasepConfigureAppCertDlls(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
VOID NTAPI BaseDllInitializeMemoryManager(VOID)
enum _BASE_SEARCH_PATH_TYPE BASE_SEARCH_PATH_TYPE
enum _BASE_SEARCH_PATH_TYPE * PBASE_SEARCH_PATH_TYPE
PRTL_CONVERT_STRINGA BasepUnicodeStringTo8BitString
struct _SXS_WIN32_NT_PATH_PAIR * PSXS_WIN32_NT_PATH_PAIR
NTSTATUS(NTAPI * PSAFER_REPLACE_PROCESS_THREAD_TOKENS)(IN HANDLE Token, IN HANDLE Process, IN HANDLE Thread)
struct _BASEP_APPCERT_ENTRY * PBASEP_APPCERT_ENTRY
struct _BASE_MSG_SXS_HANDLES * PBASE_MSG_SXS_HANDLES
NTSTATUS WINAPI BaseCreateStack(_In_ HANDLE hProcess, _In_opt_ SIZE_T StackCommit, _In_opt_ SIZE_T StackReserve, _Out_ PINITIAL_TEB InitialTeb)
struct _CODEPAGE_ENTRY * PCODEPAGE_ENTRY
ULONG(NTAPI * PRTL_COUNT_STRINGA)(IN PANSI_STRING UnicodeString)
BOOLEAN WINAPI Basep8BitStringToDynamicUnicodeString(OUT PUNICODE_STRING UnicodeString, IN LPCSTR String)
_BASE_CURRENT_DIR_PLACEMENT
@ BaseCurrentDirPlacementSafe
@ BaseCurrentDirPlacementMax
@ BaseCurrentDirPlacementInvalid
@ BaseCurrentDirPlacementDefault
RTL_CRITICAL_SECTION gcsAppCert
DWORD FilenameW2A_FitOrFail(LPSTR DestA, INT destLen, LPCWSTR SourceW, INT sourceLen)
PCODEPAGE_ENTRY FASTCALL IntGetCodePageEntry(UINT CodePage)
VOID WINAPI BaseThreadStartupThunk(VOID)
ULONG WINAPI BaseIsDosApplication(IN PUNICODE_STRING PathName, IN NTSTATUS Status)
HANDLE WINAPI BaseGetNamedObjectDirectory(VOID)
VOID WINAPI BaseMarkFileForDelete(IN HANDLE FileHandle, IN ULONG FileAttributes)
LIST_ENTRY BasepAppCertDllsList
VOID NTAPI BasepLocateExeLdrEntry(IN PLDR_DATA_TABLE_ENTRY Entry, IN PVOID Context, OUT BOOLEAN *StopEnumeration)
VOID WINAPI BaseInitializeContext(IN PCONTEXT Context, IN PVOID Parameter, IN PVOID StartAddress, IN PVOID StackAddress, IN ULONG ContextType)
ULONG(NTAPI * PRTL_COUNT_STRING)(IN PUNICODE_STRING UnicodeString)
DECLSPEC_NORETURN VOID WINAPI BaseThreadStartup(_In_ LPTHREAD_START_ROUTINE lpStartAddress, _In_ LPVOID lpParameter)
UNICODE_STRING BaseDefaultPathAppend
LPWSTR WINAPI BaseComputeProcessDllPath(IN LPWSTR FullPath, IN PVOID Environment)
PRTL_COUNT_STRINGA Basep8BitStringToUnicodeSize
WaitForInputIdleType UserWaitForInputIdleRoutine
struct _BASEP_ACTCTX_BLOCK * PBASEP_ACTCTX_BLOCK
PRTL_CONVERT_STRING Basep8BitStringToUnicodeString
NTSTATUS WINAPI BasepMapFile(IN LPCWSTR lpApplicationName, OUT PHANDLE hSection, IN PUNICODE_STRING ApplicationName)
LPTOP_LEVEL_EXCEPTION_FILTER GlobalTopLevelExceptionFilter
PUNICODE_STRING WINAPI Basep8BitStringToStaticUnicodeString(IN LPCSTR AnsiString)
POBJECT_ATTRIBUTES WINAPI BaseFormatObjectAttributes(OUT POBJECT_ATTRIBUTES ObjectAttributes, IN PSECURITY_ATTRIBUTES SecurityAttributes OPTIONAL, IN PUNICODE_STRING ObjectName)
NTSTATUS(NTAPI * PBASEP_APPCERT_PLUGIN_FUNC)(IN LPWSTR ApplicationName, IN ULONG CertFlag)
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)
BOOL BasepGetVolumeNameForVolumeMountPoint(IN LPCWSTR lpszMountPoint, OUT LPWSTR lpszVolumeName, IN DWORD cchBufferLength, OUT LPBOOL IsAMountPoint)
PRTL_COUNT_STRING BasepUnicodeStringTo8BitSize
BOOL IsThisARootDirectory(IN HANDLE VolumeHandle, IN PUNICODE_STRING NtPathName)
LPWSTR WINAPI BaseComputeProcessExePath(IN LPWSTR FullPath)
BOOLEAN WINAPI IsShimInfrastructureDisabled(VOID)
DWORD(* WaitForInputIdleType)(HANDLE hProcess, DWORD dwMilliseconds)
VOID WINAPI BasepFreeAppCompatData(IN PVOID AppCompatData, IN PVOID AppCompatSxsData)
PLDR_DATA_TABLE_ENTRY BasepExeLdrEntry
UNICODE_STRING BaseWindowsSystemDirectory
BOOL BasepGetVolumeNameFromReparsePoint(IN LPCWSTR lpszMountPoint, OUT LPWSTR lpszVolumeName, IN DWORD cchBufferLength, OUT LPBOOL IsAMountPoint)
DECLSPEC_NORETURN VOID WINAPI BaseFiberStartup(VOID)
struct _SXS_WIN32_NT_PATH_PAIR SXS_WIN32_NT_PATH_PAIR
VOID WINAPI BaseFreeThreadStack(_In_ HANDLE hProcess, _In_ PINITIAL_TEB InitialTeb)
UNICODE_STRING BaseDefaultPath
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)
NTSTATUS NTAPI BasepAllocateActivationContextActivationBlock(IN DWORD Flags, IN PVOID CompletionRoutine, IN PVOID CompletionContext, OUT PBASEP_ACTCTX_BLOCK *ActivationBlock)
VOID WINAPI BasepAnsiStringToHeapUnicodeString(IN LPCSTR AnsiString, OUT LPWSTR *UnicodeString)
NTSTATUS(NTAPI * PRTL_CONVERT_STRING)(IN PUNICODE_STRING UnicodeString, IN PANSI_STRING AnsiString, IN BOOLEAN AllocateMemory)
DECLSPEC_NORETURN VOID WINAPI BaseProcessStartup(_In_ PPROCESS_START_ROUTINE lpStartAddress)
struct _SXS_OVERRIDE_MANIFEST * PSXS_OVERRIDE_MANIFEST
struct _BASEP_ACTCTX_BLOCK BASEP_ACTCTX_BLOCK
DWORD FilenameW2A_N(LPSTR dest, INT destlen, LPCWSTR src, INT srclen)
NTSTATUS WINAPI BasepCheckWinSaferRestrictions(IN HANDLE UserToken, IN LPWSTR ApplicationName, IN HANDLE FileHandle, OUT PBOOLEAN InJob, OUT PHANDLE NewToken, OUT PHANDLE JobHandle)
PBASE_STATIC_SERVER_DATA BaseStaticServerData
struct _BASE_MSG_SXS_HANDLES BASE_MSG_SXS_HANDLES
NTSTATUS NTAPI BasepProbeForDllManifest(IN PVOID DllHandle, IN PCWSTR FullDllName, OUT PVOID *ActCtx)
VOID WINAPI InitCommandLines(VOID)
HANDLE BaseNamedObjectDirectory
RTL_CRITICAL_SECTION BaseDllDirectoryLock
DWORD FilenameU2A_FitOrFail(LPSTR DestA, INT destLen, PUNICODE_STRING SourceU)
struct _CODEPAGE_ENTRY CODEPAGE_ENTRY
NTSTATUS(NTAPI * PBASEP_APPCERT_EMBEDDED_FUNC)(IN LPWSTR ApplicationName)
VOID WINAPI BaseProcessStartThunk(VOID)
ULONG NTAPI BasepAnsiStringToUnicodeSize(IN PANSI_STRING String)
SYSTEM_BASIC_INFORMATION BaseCachedSysInfo
ULONG NTAPI BasepUnicodeStringToAnsiSize(IN PUNICODE_STRING String)
enum _BASE_CURRENT_DIR_PLACEMENT BASE_CURRENT_DIR_PLACEMENT
struct tagLOADPARMS32 LOADPARMS32
BOOLEAN BaseRunningInServerProcess
DWORD WINAPI BaseSetLastNTError(IN NTSTATUS Status)
UNICODE_STRING BaseDllDirectory
struct _SXS_OVERRIDE_MANIFEST SXS_OVERRIDE_MANIFEST
PVOID WINAPI BasepIsRealtimeAllowed(IN BOOLEAN Keep)
VOID NTAPI BasepFreeActivationContextActivationBlock(IN PBASEP_ACTCTX_BLOCK ActivationBlock)
NTSTATUS(NTAPI * PRTL_CONVERT_STRINGA)(IN PANSI_STRING AnsiString, IN PCUNICODE_STRING UnicodeString, IN BOOLEAN AllocateMemory)
DWORD(WINAPI * PPROCESS_START_ROUTINE)(VOID)
_In_ PCWSTR _Out_ PVOID * ActCtx
_In_ BOOL _In_ HANDLE hProcess
PVOID AllocateMemory(IN UINT Size)
PVOID PVOID PWCHAR PVOID USHORT ExeType
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID * SdbQueryAppCompatData
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG SxsDataSize
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID * SxsData
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG FusionFlags
PVOID PVOID PWCHAR PVOID Environment
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG SdbQueryAppCompatDataSize
PVOID PVOID PWCHAR ApplicationName
static DWORD LPDWORD LPCSTR DWORD srclen
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
#define DECLSPEC_NORETURN
PULONG MinorVersion OPTIONAL
base of all file and directory entries
LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine
PBASEP_APPCERT_PLUGIN_FUNC fPluginCertFunc
CPTABLEINFO CodePageTable
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG ValueLength
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE _In_opt_ __drv_aliasesMem WDFCONTEXT CompletionContext
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER
void(CALLBACK * LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD, DWORD, LPOVERLAPPED)
DWORD(WINAPI * LPPROGRESS_ROUTINE)(_In_ LARGE_INTEGER, _In_ LARGE_INTEGER, _In_ LARGE_INTEGER, _In_ LARGE_INTEGER, _In_ DWORD, _In_ DWORD, _In_ HANDLE, _In_ HANDLE, _In_opt_ LPVOID)
DWORD(WINAPI * LPTHREAD_START_ROUTINE)(LPVOID)
_In_ const BITMAPINFO _In_ UINT _In_opt_ HANDLE hSection
_Must_inspect_result_ _In_ ULONG Flags
_In_ PVOID _Out_opt_ PULONG_PTR _Outptr_opt_ PCUNICODE_STRING * ObjectName
_Inout_opt_ PVOID Parameter