ReactOS  0.4.12-dev-75-g00dd17e
dllmain.c File Reference
#include <user32.h>
#include <ndk/cmfuncs.h>
Include dependency graph for dllmain.c:

Go to the source code of this file.

Macros

#define KEY_LENGTH   1024
 
#define WIN_OBJ_DIR   L"\\Windows"
 
#define SESSION_DIR   L"\\Sessions"
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
BOOL GetDllList (VOID)
 
VOID LoadAppInitDlls (VOID)
 
VOID UnloadAppInitDlls (VOID)
 
VOID WINAPI GdiProcessSetup (VOID)
 
BOOL WINAPI ClientThreadSetupHelper (BOOL IsCallback)
 
BOOL WINAPI ClientThreadSetup (VOID)
 
BOOL Init (PUSERCONNECT UserCon)
 
VOID Cleanup (VOID)
 
INT WINAPI DllMain (IN PVOID hInstanceDll, IN ULONG dwReason, IN PVOID reserved)
 
NTSTATUS WINAPI User32CallClientThreadSetupFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallGetCharsetInfo (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallSetWndIconsFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32DeliverUserAPC (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallOBMFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallLPKFromKernel (PVOID Arguments, ULONG ArgumentLength)
 

Variables

static ULONG User32TlsIndex
 
HINSTANCE User32Instance
 
PPROCESSINFO g_ppi = NULL
 
PUSER_HANDLE_TABLE gHandleTable = NULL
 
PUSER_HANDLE_ENTRY gHandleEntries = NULL
 
PSERVERINFO gpsi = NULL
 
SHAREDINFO gSharedInfo = {0}
 
ULONG_PTR g_ulSharedDelta
 
BOOLEAN gfLogonProcess = FALSE
 
BOOLEAN gfServerProcess = FALSE
 
BOOLEAN gfFirstThread = TRUE
 
HICON hIconSmWindows = NULL
 
HICON hIconWindows = NULL
 
WCHAR szAppInit [KEY_LENGTH]
 
PVOID apfnDispatch [USER32_CALLBACK_MAXIMUM+1]
 

Macro Definition Documentation

◆ KEY_LENGTH

#define KEY_LENGTH   1024

Definition at line 7 of file dllmain.c.

Referenced by GetDllList(), LoadAppInitDlls(), and UnloadAppInitDlls().

◆ SESSION_DIR

#define SESSION_DIR   L"\\Sessions"

Referenced by DllMain().

◆ WIN_OBJ_DIR

#define WIN_OBJ_DIR   L"\\Windows"

Referenced by DllMain().

Function Documentation

◆ Cleanup()

VOID Cleanup ( VOID  )

Definition at line 440 of file dllmain.c.

Referenced by DllMain().

441 {
444  MenuCleanup();
445  MessageCleanup();
448 }
CRITICAL_SECTION U32AccelCacheLock
Definition: accel.c:54
VOID UnloadAppInitDlls(VOID)
Definition: dllmain.c:158
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1089
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
static ULONG User32TlsIndex
Definition: dllmain.c:9
VOID DeleteFrameBrushes(VOID)
Definition: paint.c:71
VOID FASTCALL MessageCleanup(VOID)
Definition: message.c:3252
VOID MenuCleanup(VOID)
Definition: menu.c:649

◆ ClientThreadSetup()

BOOL WINAPI ClientThreadSetup ( VOID  )

Definition at line 327 of file dllmain.c.

328 {
329  //
330  // This routine, in Windows, does a lot of what Init does, but in a radically
331  // different way.
332  //
333  // In Windows, because CSRSS's threads have TIF_CSRSSTHREAD set (we have this
334  // flag in ROS but not sure if we use it), the xxxClientThreadSetup callback
335  // isn't made when CSRSS first loads WINSRV.DLL (which loads USER32.DLL).
336  //
337  // However, all the other calls are made as normal, and WINSRV.DLL loads
338  // USER32.dll, the DllMain runs, and eventually the first NtUser system call is
339  // made which initializes Win32k (and initializes the thread, but as mentioned
340  // above, the thread is marked as TIF_CSRSSTHREAD).
341  //
342  // In the DllMain of User32, there is also a CsrClientConnectToServer call to
343  // server 2 (winsrv). When this is done from CSRSS, the "InServer" flag is set,
344  // so user32 will remember that it's running inside of CSRSS. Also, another
345  // flag, called "FirstThread" is manually set by DllMain.
346  //
347  // Then, WINSRV finishes loading, and CSRSRV starts the API thread/loop. This
348  // code then calls CsrConnectToUser, which calls... ClientThreadStartup. Now
349  // this routine detects that it's in the server process, which means it's CSRSS
350  // and that the callback never happened. It does some first-time-Win32k connection
351  // initialization and caches a bunch of things -- if it's the first thread. It also
352  // acquires a critical section to initialize GDI -- and then resets the first thread
353  // flag.
354  //
355  // For now, we'll do none of this, but to support Windows' CSRSRV.DLL which calls
356  // CsrConnectToUser, we'll pretend we "did something" here. Then the rest will
357  // continue as normal.
358  //
359 
360  // FIXME: Disabling this call is a HACK!! See also User32CallClientThreadSetupFromKernel...
361  // return ClientThreadSetupHelper(FALSE);
362  TRACE("ClientThreadSetup is not implemented\n");
363  return TRUE;
364 }
#define TRUE
Definition: types.h:120
#define TRACE(s)
Definition: solgame.cpp:4

◆ ClientThreadSetupHelper()

BOOL WINAPI ClientThreadSetupHelper ( BOOL  IsCallback)

Definition at line 219 of file dllmain.c.

Referenced by Init().

220 {
221  /*
222  * Normally we are called by win32k so the win32 thread pointers
223  * should be valid as they are set in win32k::InitThreadCallback.
224  */
227 
228  TRACE("In ClientThreadSetup(IsCallback == %s, gfServerProcess = %s, IsFirstThread = %s)\n",
229  IsCallback ? "TRUE" : "FALSE", gfServerProcess ? "TRUE" : "FALSE", IsFirstThread ? "TRUE" : "FALSE");
230 
231  if (IsFirstThread)
232  GdiProcessSetup();
233 
234  /* Check for already initialized thread, and bail out if so */
235  if (ClientInfo->CI_flags & CI_INITTHREAD)
236  {
237  ERR("ClientThreadSetup: Thread already initialized.\n");
238  return FALSE;
239  }
240 
241  /*
242  * CSRSS couldn't use user32::DllMain CSR server-to-server call to connect
243  * to win32k. So it is delayed to a manually-call to ClientThreadSetup.
244  * Also this needs to be done only for the first thread (since the connection
245  * is per-process).
246  */
247  if (gfServerProcess && IsFirstThread)
248  {
250  USERCONNECT UserCon;
251 
252  RtlZeroMemory(&UserCon, sizeof(UserCon));
253 
254  /* Minimal setup of the connect info structure */
255  UserCon.ulVersion = USER_VERSION;
256 
257  /* Connect to win32k */
259  &UserCon,
260  sizeof(UserCon));
261  if (!NT_SUCCESS(Status)) return FALSE;
262 
263  /* Retrieve data */
264  g_ppi = ClientInfo->ppi; // Snapshot PI, used as pointer only!
266  gpsi = SharedPtrToUser(UserCon.siClient.psi);
269  gSharedInfo = UserCon.siClient;
270 
271  // ERR("1 SI 0x%x : HT 0x%x : D 0x%x\n", UserCon.siClient.psi, UserCon.siClient.aheList, g_ulSharedDelta);
272  }
273 
274  TRACE("Checkpoint (register PFN)\n");
275  if (!RegisterClientPFN())
276  {
277  ERR("RegisterClientPFN failed\n");
278  return FALSE;
279  }
280 
281  /* Mark this thread as initialized */
282  ClientInfo->CI_flags |= CI_INITTHREAD;
283 
284  /* Initialization that should be done once per process */
285  if (IsFirstThread)
286  {
287  TRACE("Checkpoint (Allocating TLS)\n");
288 
289  /* Allocate an index for user32 thread local data */
292  return FALSE;
293 
294  // HAAAAAAAAAACK!!!!!!
295  // ASSERT(gpsi);
296  if (!gpsi) ERR("AAAAAAAAAAAHHHHHHHHHHHHHH!!!!!!!! gpsi == NULL !!!!\n");
297  if (gpsi)
298  {
299  TRACE("Checkpoint (MessageInit)\n");
300 
301  if (MessageInit())
302  {
303  TRACE("Checkpoint (MenuInit)\n");
304  if (MenuInit())
305  {
306  TRACE("Checkpoint initialization done OK\n");
308  LoadAppInitDlls();
309  return TRUE;
310  }
311  MessageCleanup();
312  }
313 
315  return FALSE;
316  }
317  }
318 
319  return TRUE;
320 }
signed char * PCHAR
Definition: retypes.h:7
BOOL MenuInit(VOID)
Definition: menu.c:361
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
ULONG_PTR CI_flags
Definition: ntuser.h:287
#define USER_VERSION
Definition: ntuser.h:1098
#define GetWin32ClientInfo()
Definition: ntuser.h:320
PUSER_HANDLE_TABLE gHandleTable
Definition: dllmain.c:13
PUSER_HANDLE_ENTRY gHandleEntries
Definition: dllmain.c:14
char _InterlockedExchange8(_Interlocked_operand_ char volatile *_Target, char _Value)
CLIENT_DATA ClientInfo
#define CI_INITTHREAD
Definition: ntuser.h:280
VOID WINAPI GdiProcessSetup(VOID)
Definition: dllmain.c:41
VOID LoadAppInitDlls(VOID)
Definition: dllmain.c:125
unsigned char BOOLEAN
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
CRITICAL_SECTION U32AccelCacheLock
Definition: accel.c:54
BOOL WINAPI RegisterClientPFN(VOID)
Definition: regcontrol.c:143
#define NtCurrentProcess()
Definition: nt_native.h:1657
PSERVERINFO psi
Definition: ntuser.h:1079
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1089
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
ULONG ulVersion
Definition: ntuser.h:1091
static ULONG User32TlsIndex
Definition: dllmain.c:9
BOOLEAN gfServerProcess
Definition: dllmain.c:19
DWORD WINAPI TlsAlloc(VOID)
Definition: thread.c:1023
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:530
ULONG_PTR ulSharedDelta
Definition: ntuser.h:1082
Status
Definition: gdiplustypes.h:24
VOID FASTCALL MessageCleanup(VOID)
Definition: message.c:3252
#define ERR(fmt,...)
Definition: debug.h:109
SHAREDINFO siClient
Definition: ntuser.h:1094
PUSER_HANDLE_ENTRY handles
Definition: ntuser.h:35
PPROCESSINFO g_ppi
Definition: dllmain.c:12
static __inline PVOID SharedPtrToUser(PVOID Ptr)
Definition: user_x.h:4
BOOL FASTCALL MessageInit(VOID)
Definition: message.c:3244
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
SHAREDINFO gSharedInfo
Definition: dllmain.c:16
struct _PROCESSINFO * ppi
Definition: ntuser.h:314
BOOLEAN gfFirstThread
Definition: dllmain.c:20
ULONG_PTR g_ulSharedDelta
Definition: dllmain.c:17
NTSTATUS NTAPI NtUserProcessConnect(IN HANDLE ProcessHandle, OUT PUSERCONNECT pUserConnect, IN ULONG Size)
Definition: ntstubs.c:529
PVOID aheList
Definition: ntuser.h:1080
PSERVERINFO gpsi
Definition: dllmain.c:15

◆ DllMain()

INT WINAPI DllMain ( IN PVOID  hInstanceDll,
IN ULONG  dwReason,
IN PVOID  reserved 
)

Definition at line 451 of file dllmain.c.

455 {
456  switch (dwReason)
457  {
458  case DLL_PROCESS_ATTACH:
459  {
460 
461 #define WIN_OBJ_DIR L"\\Windows"
462 #define SESSION_DIR L"\\Sessions"
463 
464  USERSRV_API_CONNECTINFO ConnectInfo; // USERCONNECT
465 
466 #if 0 // Disabling this code is a BIG HACK!!
467 
469  ULONG ConnectInfoSize = sizeof(ConnectInfo);
470  WCHAR SessionDir[256];
471 
472  /* Cache the PEB and Session ID */
473  PPEB Peb = NtCurrentPeb();
474  ULONG SessionId = Peb->SessionId; // gSessionId
475 
476  TRACE("user32::DllMain\n");
477 
478  /* Don't bother us for each thread */
479  DisableThreadLibraryCalls(hInstanceDll);
480 
481  RtlZeroMemory(&ConnectInfo, sizeof(ConnectInfo));
482 
483  /* Minimal setup of the connect info structure */
484  ConnectInfo.ulVersion = USER_VERSION;
485 
486  /* Setup the Object Directory path */
487  if (!SessionId)
488  {
489  /* Use the raw path */
490  wcscpy(SessionDir, WIN_OBJ_DIR);
491  }
492  else
493  {
494  /* Use the session path */
495  swprintf(SessionDir,
496  L"%ws\\%ld%ws",
497  SESSION_DIR,
498  SessionId,
499  WIN_OBJ_DIR);
500  }
501 
502  TRACE("Checkpoint (call CSR)\n");
503 
504  /* Connect to the USER Server */
505  Status = CsrClientConnectToServer(SessionDir,
507  &ConnectInfo,
508  &ConnectInfoSize,
509  &gfServerProcess);
510  if (!NT_SUCCESS(Status))
511  {
512  ERR("Failed to connect to CSR (Status %lx)\n", Status);
513  return FALSE;
514  }
515 
516  TRACE("Checkpoint (CSR called)\n");
517 
518 #endif
519 
520  User32Instance = hInstanceDll;
521 
522  /* Finish initialization */
523  TRACE("Checkpoint (call Init)\n");
524  if (!Init(&ConnectInfo))
525  return FALSE;
526 
527  if (!gfServerProcess)
528  {
529 #if WIN32K_ISNT_BROKEN
531 #else
532  /* imm32 takes a refcount and prevents us from unloading */
533  LoadLibraryW(L"user32");
534 #endif
535  //
536  // Wine is stub and throws an exception so save this for real Imm32.dll testing!!!!
537  //
538  //gImmApiEntries.pImmRegisterClient(&gSharedInfo, ghImm32);
539  }
540 
541  break;
542  }
543 
544  case DLL_PROCESS_DETACH:
545  {
546  if (ghImm32)
548 
549  Cleanup();
550  break;
551  }
552  }
553 
554  /* Finally, initialize GDI */
555  return GdiDllInitialize(hInstanceDll, dwReason, reserved);
556 }
#define WIN_OBJ_DIR
PPEB Peb
Definition: dllmain.c:27
HINSTANCE ghImm32
Definition: imm.c:22
BOOL WINAPI InitializeImmEntryTable(VOID)
Definition: imm.c:183
#define USERSRV_SERVERDLL_INDEX
Definition: winmsg.h:15
__wchar_t WCHAR
Definition: xmlstorage.h:180
ULONG SessionId
Definition: dllmain.c:28
LONG NTSTATUS
Definition: precomp.h:26
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define USER_VERSION
Definition: ntuser.h:1098
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
BOOL Init(PUSERCONNECT UserCon)
Definition: dllmain.c:367
HINSTANCE User32Instance
Definition: dllmain.c:10
DWORD dwReason
Definition: misc.cpp:154
r reserved
Definition: btrfs.c:2640
#define LoadLibraryW(x)
Definition: compat.h:404
VOID Cleanup(VOID)
Definition: dllmain.c:440
#define SESSION_DIR
#define DLL_PROCESS_DETACH
Definition: compat.h:119
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:405
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define USERSRV_API_CONNECTINFO
Definition: winmsg.h:40
#define swprintf(buf, format,...)
Definition: sprintf.c:56
BOOL WINAPI GdiDllInitialize(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
Definition: dllmain.c:71
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
ULONG SessionId
Definition: btrfs_drv.h:1805
static const WCHAR L[]
Definition: oid.c:1087
BOOLEAN gfServerProcess
Definition: dllmain.c:19
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
#define NtCurrentPeb()
Definition: FLS.c:19
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
NTSTATUS NTAPI CsrClientConnectToServer(IN PWSTR ObjectDirectory, IN ULONG ServerId, IN PVOID ConnectionInfo, IN OUT PULONG ConnectionInfoSize, OUT PBOOLEAN ServerToServerCall)
Definition: connect.c:192

◆ GdiProcessSetup()

VOID WINAPI GdiProcessSetup ( VOID  )

Definition at line 41 of file dllmain.c.

Referenced by ClientThreadSetupHelper(), and GdiDllInitialize().

42 {
44 
45  /* map the gdi handle table to user space */
46  GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
47  GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
49  CurrentProcessId = NtCurrentTeb()->ClientId.UniqueProcess;
50  GDI_BatchLimit = (DWORD) NtCurrentTeb()->ProcessEnvironmentBlock->GdiDCAttributeList;
51  GdiHandleCache = (PGDIHANDLECACHE)NtCurrentTeb()->ProcessEnvironmentBlock->GdiHandleBuffer;
55 }
DWORD GDI_BatchLimit
Definition: misc.c:36
#define DWORD
Definition: msvc.h:34
VOID WINAPI GdiInitializeLanguagePack(_In_ DWORD InitParam)
PGDIHANDLECACHE GdiHandleCache
Definition: dllmain.c:10
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
CRITICAL_SECTION gcsClientObjLinks
Definition: clientobj.c:10
HANDLE CurrentProcessId
Definition: misc.c:35
#define GdiHandleTable
Definition: win32nt.h:36
struct _GDIHANDLECACHE * PGDIHANDLECACHE
#define GetProcessHeap()
Definition: compat.h:395
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
PGDI_SHARED_HANDLE_TABLE GdiSharedHandleTable
Definition: misc.c:34
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
RTL_CRITICAL_SECTION semLocal
Definition: dllmain.c:12
PDEVCAPS GdiDevCaps
Definition: dllmain.c:9
HANDLE hProcessHeap
Definition: kbswitch.c:25

◆ GetDllList()

BOOL GetDllList ( VOID  )

Definition at line 26 of file dllmain.c.

Referenced by LoadAppInitDlls().

27 {
30  BOOL bRet = FALSE;
31  BOOL bLoad;
32  HANDLE hKey = NULL;
33  DWORD dwSize;
35 
36  UNICODE_STRING szKeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows");
37  UNICODE_STRING szLoadName = RTL_CONSTANT_STRING(L"LoadAppInit_DLLs");
38  UNICODE_STRING szDllsName = RTL_CONSTANT_STRING(L"AppInit_DLLs");
39 
40  InitializeObjectAttributes(&Attributes, &szKeyName, OBJ_CASE_INSENSITIVE, NULL, NULL);
41  Status = NtOpenKey(&hKey, KEY_READ, &Attributes);
42  if (NT_SUCCESS(Status))
43  {
44  dwSize = sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD);
45  kvpInfo = HeapAlloc(GetProcessHeap(), 0, dwSize);
46  if (!kvpInfo)
47  goto end;
48 
49  Status = NtQueryValueKey(hKey,
50  &szLoadName,
52  kvpInfo,
53  dwSize,
54  &dwSize);
55  if (!NT_SUCCESS(Status))
56  goto end;
57 
58  RtlMoveMemory(&bLoad,
59  kvpInfo->Data,
60  kvpInfo->DataLength);
61 
62  HeapFree(GetProcessHeap(), 0, kvpInfo);
63  kvpInfo = NULL;
64 
65  if (bLoad)
66  {
67  Status = NtQueryValueKey(hKey,
68  &szDllsName,
70  NULL,
71  0,
72  &dwSize);
73  if (Status != STATUS_BUFFER_TOO_SMALL)
74  goto end;
75 
76  kvpInfo = HeapAlloc(GetProcessHeap(), 0, dwSize);
77  if (!kvpInfo)
78  goto end;
79 
80  Status = NtQueryValueKey(hKey,
81  &szDllsName,
83  kvpInfo,
84  dwSize,
85  &dwSize);
86  if (NT_SUCCESS(Status))
87  {
88  LPWSTR lpBuffer = (LPWSTR)kvpInfo->Data;
89  if (*lpBuffer != UNICODE_NULL)
90  {
91  INT bytesToCopy, nullPos;
92 
93  bytesToCopy = min(kvpInfo->DataLength, KEY_LENGTH * sizeof(WCHAR));
94 
95  if (bytesToCopy != 0)
96  {
98  kvpInfo->Data,
99  bytesToCopy);
100 
101  nullPos = (bytesToCopy / sizeof(WCHAR)) - 1;
102 
103  /* ensure string is terminated */
104  szAppInit[nullPos] = UNICODE_NULL;
105 
106  bRet = TRUE;
107  }
108  }
109  }
110  }
111  }
112 
113 end:
114  if (hKey)
115  NtClose(hKey);
116 
117  if (kvpInfo)
118  HeapFree(GetProcessHeap(), 0, kvpInfo);
119 
120  return bRet;
121 }
#define KEY_LENGTH
Definition: dllmain.c:7
#define TRUE
Definition: types.h:120
#define KEY_READ
Definition: nt_native.h:1023
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG NTSTATUS
Definition: precomp.h:26
WCHAR szAppInit[KEY_LENGTH]
Definition: dllmain.c:23
GLuint GLuint end
Definition: gl.h:1545
#define WCHAR
Definition: msvc.h:43
int32_t INT
Definition: typedefs.h:56
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:52
#define UNICODE_NULL
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:163
smooth NULL
Definition: ftsmooth.c:416
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)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
if(!(yy_init))
Definition: macro.lex.yy.c:717
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
unsigned long DWORD
Definition: ntddk_ex.h:95
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3393
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
static const WCHAR L[]
Definition: oid.c:1087
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
struct _KEY_VALUE_PARTIAL_INFORMATION KEY_VALUE_PARTIAL_INFORMATION
#define min(a, b)
Definition: monoChain.cc:55
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
Definition: ntapi.c:336
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14

◆ Init()

BOOL Init ( PUSERCONNECT  UserCon)

Definition at line 367 of file dllmain.c.

Referenced by ATL::_ATL_MSG::_ATL_MSG(), AdapterControl(), anonymous_namespace{mstscax.cpp}::CAdvancedSettings::CAdvancedSettings(), CloseStreamRoutine(), CMiniportDMusUART::DataRangeIntersection(), DllMain(), ShellBrowser::get_root(), CPortPinWavePci::HandleKsStream(), NewAdapter(), CPortFilterWaveRT::QueryInterface(), CPortFilterDMus::QueryInterface(), CIrpQueue::QueryInterface(), CPortFilterTopology::QueryInterface(), CPortFilterWaveCyclic::QueryInterface(), CPortPinDMus::QueryInterface(), CPortFilterWavePci::QueryInterface(), CPortDMus::QueryInterface(), CPortTopology::QueryInterface(), CPortWaveRT::QueryInterface(), CPortWavePci::QueryInterface(), CPortWaveCyclic::QueryInterface(), CMiniportDMusUARTStream::STDMETHODIMP_(), TbdCreateToolbarWnd(), CPortPinWaveCyclic::UpdateCommonBufferOverlap(), CCMITopology::~CCMITopology(), CMiniportDMusUART::~CMiniportDMusUART(), CMiniportDMusUARTStream::~CMiniportDMusUARTStream(), and CMiniportWaveCMI::~CMiniportWaveCMI().

368 {
370 
371  TRACE("user32::Init(0x%p) -->\n", UserCon);
372 
374 
375  /* Initialize callback table in PEB data */
376  NtCurrentPeb()->KernelCallbackTable = apfnDispatch;
377  NtCurrentPeb()->PostProcessInitRoutine = NULL;
378 
379  // This is a HACK!! //
383 
384  /*
385  * Retrieve data from the connect info structure if the initializing
386  * process is not CSRSS. In case it is, this will be done from inside
387  * ClientThreadSetup.
388  */
389  if (!gfServerProcess)
390  {
391  // FIXME: HACK!! We should fixup for the NtUserProcessConnect fixups
392  // because it was made in the context of CSRSS process and not ours!!
393  // So... as long as we don't fix that, we need to redo again a call
394  // to NtUserProcessConnect... How perverse is that?!
395  //
396  // HACK(2): This call is necessary since we disabled
397  // the CSR call in DllMain...
398  {
399  RtlZeroMemory(UserCon, sizeof(*UserCon));
400 
401  /* Minimal setup of the connect info structure */
402  UserCon->ulVersion = USER_VERSION;
403 
404  TRACE("HACK: Hackish NtUserProcessConnect call!!\n");
405  /* Connect to win32k */
407  UserCon,
408  sizeof(*UserCon));
409  if (!NT_SUCCESS(Status)) return FALSE;
410  }
411 
412  //
413  // We continue as we should do normally...
414  //
415 
416  /* Retrieve data */
417  g_ppi = GetWin32ClientInfo()->ppi; // Snapshot PI, used as pointer only!
419  gpsi = SharedPtrToUser(UserCon->siClient.psi);
422  gSharedInfo = UserCon->siClient;
423  }
424 
425  // FIXME: Yet another hack... This call should normally not be done here, but
426  // instead in ClientThreadSetup, and in User32CallClientThreadSetupFromKernel as well.
427  TRACE("HACK: Using Init-ClientThreadSetupHelper hack!!\n");
429  {
430  TRACE("Init-ClientThreadSetupHelper hack failed!\n");
431  return FALSE;
432  }
433 
434  TRACE("<-- user32::Init()\n");
435 
436  return NT_SUCCESS(Status);
437 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
#define USER_VERSION
Definition: ntuser.h:1098
#define GetWin32ClientInfo()
Definition: ntuser.h:320
PUSER_HANDLE_TABLE gHandleTable
Definition: dllmain.c:13
PUSER_HANDLE_ENTRY gHandleEntries
Definition: dllmain.c:14
PVOID apfnDispatch[USER32_CALLBACK_MAXIMUM+1]
Definition: dllmain.c:190
smooth NULL
Definition: ftsmooth.c:416
#define NtCurrentProcess()
Definition: nt_native.h:1657
PSERVERINFO psi
Definition: ntuser.h:1079
#define TRACE(s)
Definition: solgame.cpp:4
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
ULONG ulVersion
Definition: ntuser.h:1091
RTL_CRITICAL_SECTION gcsUserApiHook
Definition: usrapihk.c:39
BOOLEAN gfServerProcess
Definition: dllmain.c:19
ULONG_PTR ulSharedDelta
Definition: ntuser.h:1082
Status
Definition: gdiplustypes.h:24
#define NtCurrentPeb()
Definition: FLS.c:19
SHAREDINFO siClient
Definition: ntuser.h:1094
PUSER_HANDLE_ENTRY handles
Definition: ntuser.h:35
PPROCESSINFO g_ppi
Definition: dllmain.c:12
BOOL WINAPI ClientThreadSetupHelper(BOOL IsCallback)
Definition: dllmain.c:219
static __inline PVOID SharedPtrToUser(PVOID Ptr)
Definition: user_x.h:4
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
SHAREDINFO gSharedInfo
Definition: dllmain.c:16
BOOLEAN gfFirstThread
Definition: dllmain.c:20
return STATUS_SUCCESS
Definition: btrfs.c:2710
ULONG_PTR g_ulSharedDelta
Definition: dllmain.c:17
NTSTATUS NTAPI NtUserProcessConnect(IN HANDLE ProcessHandle, OUT PUSERCONNECT pUserConnect, IN ULONG Size)
Definition: ntstubs.c:529
PVOID aheList
Definition: ntuser.h:1080
PSERVERINFO gpsi
Definition: dllmain.c:15

◆ LoadAppInitDlls()

VOID LoadAppInitDlls ( VOID  )

Definition at line 125 of file dllmain.c.

Referenced by ClientThreadSetupHelper().

126 {
127  szAppInit[0] = UNICODE_NULL;
128 
129  if (GetDllList())
130  {
132  LPWSTR ptr;
133  size_t i;
134 
135  RtlCopyMemory(buffer, szAppInit, KEY_LENGTH * sizeof(WCHAR) );
136 
137  for (i = 0; i < KEY_LENGTH; ++ i)
138  {
139  if(buffer[i] == L' ' || buffer[i] == L',')
140  buffer[i] = 0;
141  }
142 
143  for (i = 0; i < KEY_LENGTH; )
144  {
145  if(buffer[i] == 0)
146  ++ i;
147  else
148  {
149  ptr = buffer + i;
150  i += wcslen(ptr);
151  LoadLibraryW(ptr);
152  }
153  }
154  }
155 }
#define KEY_LENGTH
Definition: dllmain.c:7
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR szAppInit[KEY_LENGTH]
Definition: dllmain.c:23
GLuint buffer
Definition: glext.h:5915
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define UNICODE_NULL
static PVOID ptr
Definition: dispmode.c:27
#define LoadLibraryW(x)
Definition: compat.h:404
static const WCHAR L[]
Definition: oid.c:1087
BOOL GetDllList(VOID)
Definition: dllmain.c:26
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

◆ UnloadAppInitDlls()

VOID UnloadAppInitDlls ( VOID  )

Definition at line 158 of file dllmain.c.

Referenced by Cleanup().

159 {
160  if (szAppInit[0] != UNICODE_NULL)
161  {
164  LPWSTR ptr;
165  size_t i;
166 
167  RtlCopyMemory(buffer, szAppInit, KEY_LENGTH * sizeof(WCHAR));
168 
169  for (i = 0; i < KEY_LENGTH; ++ i)
170  {
171  if(buffer[i] == L' ' || buffer[i] == L',')
172  buffer[i] = 0;
173  }
174 
175  for (i = 0; i < KEY_LENGTH; )
176  {
177  if(buffer[i] == 0)
178  ++ i;
179  else
180  {
181  ptr = buffer + i;
182  i += wcslen(ptr);
183  hModule = GetModuleHandleW(ptr);
184  FreeLibrary(hModule);
185  }
186  }
187  }
188 }
#define KEY_LENGTH
Definition: dllmain.c:7
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR szAppInit[KEY_LENGTH]
Definition: dllmain.c:23
GLuint buffer
Definition: glext.h:5915
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define UNICODE_NULL
static PVOID ptr
Definition: dispmode.c:27
#define FreeLibrary(x)
Definition: compat.h:405
static const WCHAR L[]
Definition: oid.c:1087
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:845
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HMODULE hModule
Definition: animate.c:44

◆ User32CallClientThreadSetupFromKernel()

NTSTATUS WINAPI User32CallClientThreadSetupFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 560 of file dllmain.c.

561 {
562  TRACE("User32CallClientThreadSetupFromKernel -->\n");
563  // FIXME: Disabling this call is a HACK!! See also ClientThreadSetup...
564  // ClientThreadSetupHelper(TRUE);
565  TRACE("<-- User32CallClientThreadSetupFromKernel\n");
567 }
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
return STATUS_SUCCESS
Definition: btrfs.c:2710

◆ User32CallGetCharsetInfo()

NTSTATUS WINAPI User32CallGetCharsetInfo ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 571 of file dllmain.c.

572 {
573  BOOL Ret;
574  PGET_CHARSET_INFO pgci = (PGET_CHARSET_INFO)Arguments;
575 
576  TRACE("GetCharsetInfo\n");
577 
578  Ret = TranslateCharsetInfo((DWORD *)(ULONG_PTR)pgci->Locale, &pgci->Cs, TCI_SRCLOCALE);
579 
580  return ZwCallbackReturn(Arguments, ArgumentLength, Ret ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
581 }
#define TCI_SRCLOCALE
Definition: wingdi.h:962
uint32_t ULONG_PTR
Definition: typedefs.h:63
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
CHARSETINFO Cs
Definition: callback.h:115
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
struct _GET_CHARSET_INFO * PGET_CHARSET_INFO
return STATUS_SUCCESS
Definition: btrfs.c:2710

◆ User32CallLPKFromKernel()

NTSTATUS WINAPI User32CallLPKFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 646 of file dllmain.c.

647 {
648  BOOL bResult;
649  PLPK_CALLBACK_ARGUMENTS Argument;
650 
651  Argument = (PLPK_CALLBACK_ARGUMENTS)Arguments;
652 
653  Argument->lpString = (LPWSTR)((ULONG_PTR)Argument->lpString + (ULONG_PTR)Argument);
654 
655  bResult = ExtTextOutW(Argument->hdc,
656  Argument->x,
657  Argument->y,
658  Argument->flags,
659  (Argument->bRect) ? &Argument->rect : NULL,
660  Argument->lpString,
661  Argument->count,
662  NULL);
663 
664  return ZwCallbackReturn(&bResult, sizeof(BOOL), STATUS_SUCCESS);
665 }
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)
uint32_t ULONG_PTR
Definition: typedefs.h:63
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
smooth NULL
Definition: ftsmooth.c:416
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ULONG_PTR
Definition: config.h:101
struct _LPK_CALLBACK_ARGUMENTS * PLPK_CALLBACK_ARGUMENTS
WCHAR * LPWSTR
Definition: xmlstorage.h:184
return STATUS_SUCCESS
Definition: btrfs.c:2710

◆ User32CallOBMFromKernel()

NTSTATUS WINAPI User32CallOBMFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 614 of file dllmain.c.

615 {
616  BITMAP bmp;
617  PSETOBM_CALLBACK_ARGUMENTS Common = Arguments;
618 
619  GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_CLOSE)), sizeof(bmp), &bmp);
620  Common->oembmi[OBI_CLOSE].cx = bmp.bmWidth;
621  Common->oembmi[OBI_CLOSE].cy = bmp.bmHeight;
622 
623  GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_MNARROW)), sizeof(bmp), &bmp);
624  Common->oembmi[OBI_MNARROW].cx = bmp.bmWidth;
625  Common->oembmi[OBI_MNARROW].cy = bmp.bmHeight;
626 
627  GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_DNARROW)), sizeof(bmp), &bmp);
628  Common->oembmi[OBI_DNARROW].cx = bmp.bmWidth;
629  Common->oembmi[OBI_DNARROW].cy = bmp.bmHeight;
630 
631  GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_DNARROWI)), sizeof(bmp), &bmp);
632  Common->oembmi[OBI_DNARROWI].cx = bmp.bmWidth;
633  Common->oembmi[OBI_DNARROWI].cy = bmp.bmHeight;
634 
635  GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_UPARROW)), sizeof(bmp), &bmp);
636  Common->oembmi[OBI_UPARROW].cx = bmp.bmWidth;
637  Common->oembmi[OBI_UPARROW].cy = bmp.bmHeight;
638 
639  GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_UPARROWI)), sizeof(bmp), &bmp);
640  Common->oembmi[OBI_UPARROWI].cx = bmp.bmWidth;
641  Common->oembmi[OBI_UPARROWI].cy = bmp.bmHeight;
642 
643  return ZwCallbackReturn(Arguments, ArgumentLength, STATUS_SUCCESS);
644 }
#define OBM_DNARROW
Definition: winuser.h:1116
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define OBM_CLOSE
Definition: winuser.h:1118
BITMAP bmp
Definition: alphablend.c:62
#define OBM_UPARROWI
Definition: winuser.h:1101
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define OBM_MNARROW
Definition: winuser.h:1103
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2132
Definition: bl.h:1331
#define OBM_DNARROWI
Definition: winuser.h:1100
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
return STATUS_SUCCESS
Definition: btrfs.c:2710
struct tagOEMBITMAPINFO oembmi[93]
Definition: callback.h:140
#define OBM_UPARROW
Definition: winuser.h:1117

◆ User32CallSetWndIconsFromKernel()

NTSTATUS WINAPI User32CallSetWndIconsFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 585 of file dllmain.c.

586 {
587  PSETWNDICONS_CALLBACK_ARGUMENTS Common = Arguments;
588 
589  if (!gpsi->hIconSmWindows)
590  {
592  Common->hIconHand = LoadImageW(0, IDI_HAND, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);
598  hIconWindows = Common->hIconWindows;
599  hIconSmWindows = Common->hIconSmWindows;
600  }
601  ERR("hIconSmWindows %p hIconWindows %p \n",hIconSmWindows,hIconWindows);
602  return ZwCallbackReturn(Arguments, ArgumentLength, STATUS_SUCCESS);
603 }
#define IMAGE_ICON
Definition: winuser.h:212
#define SM_CYSMICON
Definition: winuser.h:1003
#define IDI_APPLICATION
Definition: winuser.h:699
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define IDI_EXCLAMATION
Definition: winuser.h:702
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
HICON hIconWindows
Definition: dllmain.c:21
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
#define IDI_WINLOGO
Definition: winuser.h:704
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1002
#define ERR(fmt,...)
Definition: debug.h:109
#define IDI_QUESTION
Definition: winuser.h:701
HICON hIconSmWindows
Definition: dllmain.c:21
return STATUS_SUCCESS
Definition: btrfs.c:2710
#define IDI_ASTERISK
Definition: winuser.h:703
#define IDI_HAND
Definition: winuser.h:700
PSERVERINFO gpsi
Definition: dllmain.c:15

◆ User32DeliverUserAPC()

NTSTATUS WINAPI User32DeliverUserAPC ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 607 of file dllmain.c.

608 {
609  return ZwCallbackReturn(0, 0, STATUS_SUCCESS);
610 }
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
return STATUS_SUCCESS
Definition: btrfs.c:2710

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )

Variable Documentation

◆ apfnDispatch

PVOID apfnDispatch[USER32_CALLBACK_MAXIMUM+1]
Initial value:
=
{
}
NTSTATUS WINAPI User32CallDDEGetFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: dde.c:288
NTSTATUS WINAPI User32CallSetWndIconsFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: dllmain.c:585
NTSTATUS WINAPI User32CallCopyImageFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: cursoricon.c:1938
NTSTATUS WINAPI User32CallDDEPostFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: dde.c:256
NTSTATUS WINAPI User32SetupDefaultCursors(PVOID Arguments, ULONG ArgumentLength)
Definition: cursoricon.c:48
NTSTATUS WINAPI User32CallClientThreadSetupFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: dllmain.c:560
NTSTATUS WINAPI User32CallGetCharsetInfo(PVOID Arguments, ULONG ArgumentLength)
Definition: dllmain.c:571
NTSTATUS WINAPI User32DeliverUserAPC(PVOID Arguments, ULONG ArgumentLength)
Definition: dllmain.c:607
NTSTATUS WINAPI User32LoadSysMenuTemplateForKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: menu.c:655
NTSTATUS WINAPI User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: message.c:2902
NTSTATUS WINAPI User32CallLPKFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: dllmain.c:646
NTSTATUS WINAPI User32CallSendAsyncProcForKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: window.c:24
NTSTATUS WINAPI User32CallEventProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: hook.c:783
NTSTATUS WINAPI User32CallOBMFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: dllmain.c:614
NTSTATUS WINAPI User32CallClientLoadLibraryFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: hook.c:528
NTSTATUS WINAPI User32CallLoadMenuFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: menu.c:665
NTSTATUS WINAPI User32CallHookProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
Definition: hook.c:554

Definition at line 190 of file dllmain.c.

Referenced by Init().

◆ g_ppi

PPROCESSINFO g_ppi = NULL

Definition at line 12 of file dllmain.c.

Referenced by ValidateCallProc().

◆ g_ulSharedDelta

ULONG_PTR g_ulSharedDelta

Definition at line 17 of file dllmain.c.

Referenced by ClientThreadSetupHelper(), Init(), and SharedPtrToUser().

◆ gfFirstThread

BOOLEAN gfFirstThread = TRUE

Definition at line 20 of file dllmain.c.

Referenced by ClientThreadSetupHelper(), and Init().

◆ gfLogonProcess

BOOLEAN gfLogonProcess = FALSE

Definition at line 18 of file dllmain.c.

Referenced by RegisterLogonProcess().

◆ gfServerProcess

BOOLEAN gfServerProcess = FALSE

Definition at line 19 of file dllmain.c.

Referenced by ClientThreadSetupHelper(), DllMain(), Init(), and LoadUserApiHook().

◆ gHandleEntries

PUSER_HANDLE_ENTRY gHandleEntries = NULL

Definition at line 14 of file dllmain.c.

Referenced by GetUser32Handle().

◆ gHandleTable

PUSER_HANDLE_TABLE gHandleTable = NULL

Definition at line 13 of file dllmain.c.

◆ gpsi

PSERVERINFO gpsi = NULL

Definition at line 15 of file dllmain.c.

◆ gSharedInfo

SHAREDINFO gSharedInfo = {0}

Definition at line 16 of file dllmain.c.

Referenced by User32InitializeImmEntryTable().

◆ hIconSmWindows

HICON hIconSmWindows = NULL

Definition at line 21 of file dllmain.c.

Referenced by User32CallSetWndIconsFromKernel().

◆ hIconWindows

HICON hIconWindows = NULL

Definition at line 21 of file dllmain.c.

Referenced by User32CallSetWndIconsFromKernel().

◆ szAppInit

WCHAR szAppInit[KEY_LENGTH]

Definition at line 23 of file dllmain.c.

Referenced by GetDllList(), LoadAppInitDlls(), and UnloadAppInitDlls().

◆ User32Instance

◆ User32TlsIndex

ULONG User32TlsIndex
static

Definition at line 9 of file dllmain.c.

Referenced by Cleanup(), and ClientThreadSetupHelper().