5#define MAX_USER_MODE_DRV_BUFFER 526
24#define KEY_LENGTH 1024
107 INT bytesToCopy, nullPos;
111 if (bytesToCopy != 0)
117 nullPos = (bytesToCopy /
sizeof(
WCHAR)) - 1;
206#define DEFINE_USER32_CALLBACK(id, value, fn) fn,
213#undef DEFINE_USER32_CALLBACK
230 TRACE(
"In ClientThreadSetup(IsCallback == %s, gfServerProcess = %s, IsFirstThread = %s)\n",
231 IsCallback ?
"TRUE" :
"FALSE",
gfServerProcess ?
"TRUE" :
"FALSE", IsFirstThread ?
"TRUE" :
"FALSE");
239 ERR(
"ClientThreadSetup: Thread already initialized.\n");
277 TRACE(
"Checkpoint (register PFN)\n");
280 ERR(
"RegisterClientPFN failed\n");
290 TRACE(
"Checkpoint (Allocating TLS)\n");
299 if (!
gpsi)
ERR(
"AAAAAAAAAAAHHHHHHHHHHHHHH!!!!!!!! gpsi == NULL !!!!\n");
302 TRACE(
"Checkpoint (MessageInit)\n");
306 TRACE(
"Checkpoint (MenuInit)\n");
309 TRACE(
"Checkpoint initialization done OK\n");
365 TRACE(
"ClientThreadSetup is not implemented\n");
374 TRACE(
"user32::Init(0x%p) -->\n", UserCon);
408 TRACE(
"HACK: Hackish NtUserProcessConnect call!!\n");
430 TRACE(
"HACK: Using Init-ClientThreadSetupHelper hack!!\n");
433 TRACE(
"Init-ClientThreadSetupHelper hack failed!\n");
437 TRACE(
"<-- user32::Init()\n");
466#define WIN_OBJ_DIR L"\\Windows"
467#define SESSION_DIR L"\\Sessions"
474 ULONG ConnectInfoSize =
sizeof(ConnectInfo);
475 WCHAR SessionDir[256];
481 TRACE(
"user32::DllMain\n");
507 TRACE(
"Checkpoint (call CSR)\n");
517 ERR(
"Failed to connect to CSR (Status %lx)\n",
Status);
521 TRACE(
"Checkpoint (CSR called)\n");
528 TRACE(
"Checkpoint (call Init)\n");
529 if (!
Init(&ConnectInfo))
568 TRACE(
"User32CallClientThreadSetupFromKernel -->\n");
571 TRACE(
"<-- User32CallClientThreadSetupFromKernel\n");
582 TRACE(
"GetCharsetInfo\n");
595 if (!
gpsi->hIconSmWindows)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
#define NT_SUCCESS(StatCode)
BOOL WINAPI DllMain(HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpvReserved)
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
#define HeapFree(x, y, z)
BOOL WINAPI ImmLoadLayout(HKL hKL, PIMEINFOEX pImeInfoEx)
BOOL WINAPI ImmRegisterClient(PSHAREDINFO ptr, HINSTANCE hMod)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
DWORD WINAPI TlsAlloc(VOID)
BOOL WINAPI TlsFree(IN DWORD Index)
static const WCHAR Cleanup[]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define GetWin32ClientInfo()
NTSTATUS NTAPI NtUserProcessConnect(IN HANDLE ProcessHandle, OUT PUSERCONNECT pUserConnect, IN ULONG Size)
#define OBJ_CASE_INSENSITIVE
char _InterlockedExchange8(_Interlocked_operand_ char volatile *_Target, char _Value)
DWORD WINAPI ImmProcessKey(HWND hWnd, HKL hKL, UINT vKey, LPARAM lParam, DWORD dwHotKeyID)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
@ KeyValuePartialInformation
#define NtCurrentProcess()
NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
struct _KEY_VALUE_PARTIAL_INFORMATION KEY_VALUE_PARTIAL_INFORMATION
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
BOOL WINAPI RegisterClientPFN(VOID)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
NTSTATUS NTAPI CsrClientConnectToServer(_In_ PCWSTR ObjectDirectory, _In_ ULONG ServerId, _In_ PVOID ConnectionInfo, _Inout_ PULONG ConnectionInfoSize, _Out_ PBOOLEAN ServerToServerCall)
#define STATUS_BUFFER_TOO_SMALL
struct tagOEMBITMAPINFO oembmi[93]
PUSER_HANDLE_ENTRY handles
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
#define RTL_CONSTANT_STRING(s)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_UNSUCCESSFUL
RTL_CRITICAL_SECTION gcsUserApiHook
VOID FASTCALL MessageCleanup(VOID)
HRESULT User32GetImmFileName(_Out_ LPWSTR lpBuffer, _In_ size_t cchBuffer)
BOOL FASTCALL MessageInit(VOID)
BOOL WINAPI InitializeImmEntryTable(VOID)
CRITICAL_SECTION U32AccelCacheLock
VOID DeleteFrameBrushes(VOID)
static __inline PVOID SharedPtrToUser(PVOID Ptr)
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
BOOL WINAPI GdiDllInitialize(_In_ HANDLE hDll, _In_ ULONG dwReason, _In_opt_ PVOID pReserved)
VOID WINAPI GdiProcessSetup(VOID)
struct _LPK_CALLBACK_ARGUMENTS * PLPK_CALLBACK_ARGUMENTS
struct _GET_CHARSET_INFO * PGET_CHARSET_INFO
struct _UMPDPKTHEAD * PUMPDPKTHEAD
static ULONG User32TlsIndex
NTSTATUS WINAPI User32DeliverUserAPC(PVOID Arguments, ULONG ArgumentLength)
NTSTATUS WINAPI User32CallClientThreadSetupFromKernel(PVOID Arguments, ULONG ArgumentLength)
PUSER_HANDLE_ENTRY gHandleEntries
WCHAR szAppInit[KEY_LENGTH]
PUSER_HANDLE_TABLE gHandleTable
VOID UnloadAppInitDlls(VOID)
VOID LoadAppInitDlls(VOID)
PVOID apfnDispatch[USER32_CALLBACK_COUNT]
NTSTATUS WINAPI User32CallSetWndIconsFromKernel(PVOID Arguments, ULONG ArgumentLength)
NTSTATUS WINAPI User32CallImmLoadLayoutFromKernel(PVOID Arguments, ULONG ArgumentLength)
#define MAX_USER_MODE_DRV_BUFFER
NTSTATUS WINAPI User32CallImmProcessKeyFromKernel(PVOID Arguments, ULONG ArgumentLength)
NTSTATUS WINAPI User32CallGetCharsetInfo(PVOID Arguments, ULONG ArgumentLength)
NTSTATUS WINAPI User32CallLPKFromKernel(PVOID Arguments, ULONG ArgumentLength)
struct _UMPDPKTHEAD UMPDPKTHEAD
BOOL WINAPI ClientThreadSetupHelper(BOOL IsCallback)
INT WINAPI GdiPrinterThunk(PUMPDPKTHEAD, PVOID, INT)
NTSTATUS WINAPI User32CallUMPDFromKernel(PVOID Arguments, ULONG ArgumentLength)
BOOL WINAPI ClientThreadSetup(VOID)
NTSTATUS WINAPI User32CallOBMFromKernel(PVOID Arguments, ULONG ArgumentLength)
#define TLS_OUT_OF_INDEXES
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
#define USERSRV_SERVERDLL_INDEX
#define USERSRV_API_CONNECTINFO
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
#define MAKEINTRESOURCEW(i)
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
int WINAPI GetSystemMetrics(_In_ int)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO