ReactOS  0.4.12-dev-916-gffc4e30
ldevobj.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Win32k subsystem
4  * PURPOSE: Support for logical devices
5  * FILE: win32ss/gdi/eng/ldevobj.c
6  * PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
7  */
8 
9 #include <win32k.h>
10 #define NDEBUG
11 #include <debug.h>
12 DBG_DEFAULT_CHANNEL(EngLDev);
13 
14 #ifndef RVA_TO_ADDR
15 #define RVA_TO_ADDR(Base,Rva) ((PVOID)(((ULONG_PTR)(Base)) + (Rva)))
16 #endif
17 
23 
24 
27 INIT_FUNCTION
29 NTAPI
31 {
32  ULONG cbSize;
33 
34  /* Initialize the LDEV list head */
36 
37  /* Initialize the loader lock */
39  if (!ghsemLDEVList)
40  {
41  ERR("Failed to create ghsemLDEVList\n");
43  }
44 
45  /* Allocate a LDEVOBJ for win32k */
47  sizeof(LDEVOBJ) +
49  GDITAG_LDEV);
50  if (!gpldevWin32k)
51  {
52  return STATUS_NO_MEMORY;
53  }
54 
55  /* Initialize the LDEVOBJ for win32k */
59  gpldevWin32k->cRefs = 1;
63  L"\\SystemRoot\\System32\\win32k.sys");
69  TRUE,
71  &cbSize);
73 
74  return STATUS_SUCCESS;
75 }
76 
77 static
80  _In_ LDEVTYPE ldevtype)
81 {
82  PLDEVOBJ pldev;
83 
84  /* Allocate the structure from paged pool */
86  if (!pldev)
87  {
88  ERR("Failed to allocate LDEVOBJ.\n");
89  return NULL;
90  }
91 
92  /* Zero out the structure */
93  RtlZeroMemory(pldev, sizeof(LDEVOBJ));
94 
95  /* Set the ldevtype */
96  pldev->ldevtype = ldevtype;
97 
98  return pldev;
99 }
100 
101 static
102 VOID
105 {
106  /* Make sure we don't have a driver loaded */
107  ASSERT(pldev && pldev->pGdiDriverInfo == NULL);
108  ASSERT(pldev->cRefs == 0);
109 
110  /* Free the memory */
112 }
113 
115 NTAPI
117  _In_ PLDEVOBJ pldev,
119 {
120  ULONG cbSize, cbFull;
121  PDEVMODEINFO pdminfo;
122 
123  TRACE("LDEVOBJ_pdmiGetModes(%p, %p)\n", pldev, hDriver);
124 
125  /* Mirror drivers may omit this function */
126  if (!pldev->pfn.GetModes)
127  {
128  return NULL;
129  }
130 
131  /* Call the driver to get the required size */
132  cbSize = pldev->pfn.GetModes(hDriver, 0, NULL);
133  if (!cbSize)
134  {
135  ERR("DrvGetModes returned 0\n");
136  return NULL;
137  }
138 
139  /* Add space for the header */
140  cbFull = cbSize + FIELD_OFFSET(DEVMODEINFO, adevmode);
141 
142  /* Allocate a buffer for the DEVMODE array */
143  pdminfo = ExAllocatePoolWithTag(PagedPool, cbFull, GDITAG_DEVMODE);
144  if (!pdminfo)
145  {
146  ERR("Could not allocate devmodeinfo\n");
147  return NULL;
148  }
149 
150  pdminfo->pldev = pldev;
151  pdminfo->cbdevmode = cbSize;
152 
153  /* Call the driver again to fill the buffer */
154  cbSize = pldev->pfn.GetModes(hDriver, cbSize, pdminfo->adevmode);
155  if (!cbSize)
156  {
157  /* Could not get modes */
158  ERR("returned size %lu(%lu)\n", cbSize, pdminfo->cbdevmode);
160  pdminfo = NULL;
161  }
162 
163  return pdminfo;
164 }
165 
166 static
167 BOOL
169  _Inout_ PLDEVOBJ pldev,
170  _In_ PUNICODE_STRING pustrPathName)
171 {
172  PSYSTEM_GDI_DRIVER_INFORMATION pDriverInfo;
174  ULONG cbSize;
175 
176  /* Make sure no image is loaded yet */
177  ASSERT(pldev && pldev->pGdiDriverInfo == NULL);
178 
179  /* Allocate a SYSTEM_GDI_DRIVER_INFORMATION structure */
180  cbSize = sizeof(SYSTEM_GDI_DRIVER_INFORMATION) + pustrPathName->Length;
181  pDriverInfo = ExAllocatePoolWithTag(PagedPool, cbSize, GDITAG_LDEV);
182  if (!pDriverInfo)
183  {
184  ERR("Failed to allocate SYSTEM_GDI_DRIVER_INFORMATION\n");
185  return FALSE;
186  }
187 
188  /* Initialize the UNICODE_STRING and copy the driver name */
189  RtlInitEmptyUnicodeString(&pDriverInfo->DriverName,
190  (PWSTR)(pDriverInfo + 1),
191  pustrPathName->Length);
192  RtlCopyUnicodeString(&pDriverInfo->DriverName, pustrPathName);
193 
194  /* Try to load the driver */
196  pDriverInfo,
198  if (!NT_SUCCESS(Status))
199  {
200  ERR("Failed to load a GDI driver: '%wZ', Status = 0x%lx\n",
201  pustrPathName, Status);
202 
203  /* Free the allocated memory */
204  ExFreePoolWithTag(pDriverInfo, GDITAG_LDEV);
205  return FALSE;
206  }
207 
208  /* Set the driver info */
209  pldev->pGdiDriverInfo = pDriverInfo;
210 
211  /* Return success. */
212  return TRUE;
213 }
214 
215 static
216 VOID
218  _Inout_ PLDEVOBJ pldev)
219 {
221 
222  /* Make sure we have a driver info */
223  ASSERT(pldev && pldev->pGdiDriverInfo != NULL);
224 
225  /* Check if we have loaded a driver */
226  if (pldev->pfn.DisableDriver)
227  {
228  /* Call the unload function */
229  pldev->pfn.DisableDriver();
230  }
231 
232  /* Unload the driver */
234  &pldev->pGdiDriverInfo->SectionPointer,
235  sizeof(HANDLE));
236  if (!NT_SUCCESS(Status))
237  {
238  ERR("Failed to unload the driver, this is bad.\n");
239  }
240 
241  /* Free the driver info structure */
242  ExFreePoolWithTag(pldev->pGdiDriverInfo, GDITAG_LDEV);
243  pldev->pGdiDriverInfo = NULL;
244 }
245 
246 static
247 BOOL
249  _Inout_ PLDEVOBJ pldev)
250 {
251  PFN_DrvEnableDriver pfnEnableDriver;
252  DRVENABLEDATA ded;
253  ULONG i;
254 
255  /* Make sure we have a driver info */
256  ASSERT(pldev && pldev->pGdiDriverInfo != NULL);
257 
258  /* Call the drivers DrvEnableDriver function */
259  RtlZeroMemory(&ded, sizeof(ded));
260  pfnEnableDriver = pldev->pGdiDriverInfo->EntryPoint;
261  if (!pfnEnableDriver(GDI_ENGINE_VERSION, sizeof(ded), &ded))
262  {
263  ERR("DrvEnableDriver failed\n");
264  return FALSE;
265  }
266 
267  /* Copy the returned driver version */
268  pldev->ulDriverVersion = ded.iDriverVersion;
269 
270  /* Fill the driver function array */
271  for (i = 0; i < ded.c; i++)
272  {
273  pldev->apfn[ded.pdrvfn[i].iFunc] = ded.pdrvfn[i].pfn;
274  }
275 
276  /* Return success. */
277  return TRUE;
278 }
279 
280 static
281 PVOID
283  _In_ PLDEVOBJ pldev,
284  _In_z_ LPSTR pszProcName)
285 {
286  PVOID pvImageBase;
287  PIMAGE_EXPORT_DIRECTORY pExportDir;
288  PVOID pvProcAdress = NULL;
289  PUSHORT pOrdinals;
290  PULONG pNames, pAddresses;
291  ULONG i;
292 
293  /* Make sure we have a driver info */
294  ASSERT(pldev && pldev->pGdiDriverInfo != NULL);
295 
296  /* Get the pointer to the export directory */
297  pvImageBase = pldev->pGdiDriverInfo->ImageAddress;
298  pExportDir = pldev->pGdiDriverInfo->ExportSectionPointer;
299  if (!pExportDir)
300  {
301  ERR("LDEVOBJ_pvFindImageProcAddress: no export section found\n");
302  return NULL;
303  }
304 
305  /* Get pointers to some tables */
306  pNames = RVA_TO_ADDR(pvImageBase, pExportDir->AddressOfNames);
307  pOrdinals = RVA_TO_ADDR(pvImageBase, pExportDir->AddressOfNameOrdinals);
308  pAddresses = RVA_TO_ADDR(pvImageBase, pExportDir->AddressOfFunctions);
309 
310  /* Loop the export table */
311  for (i = 0; i < pExportDir->NumberOfNames; i++)
312  {
313  /* Compare the name */
314  if (_stricmp(pszProcName, RVA_TO_ADDR(pvImageBase, pNames[i])) == 0)
315  {
316  /* Found! Calculate the procedure address */
317  pvProcAdress = RVA_TO_ADDR(pvImageBase, pAddresses[pOrdinals[i]]);
318  break;
319  }
320  }
321 
322  /* Return the address */
323  return pvProcAdress;
324 }
325 
326 PLDEVOBJ
327 NTAPI
329  _In_z_ LPWSTR pwszDriverName,
330  _In_ ULONG ldevtype)
331 {
332  WCHAR acwBuffer[MAX_PATH];
333  PLIST_ENTRY pleLink;
334  PLDEVOBJ pldev;
335  UNICODE_STRING strDriverName;
336  SIZE_T cwcLength;
337  LPWSTR pwsz;
338 
339  TRACE("EngLoadImageEx(%ls, %lu)\n", pwszDriverName, ldevtype);
340  ASSERT(pwszDriverName);
341 
342  /* Initialize buffer for the the driver name */
343  RtlInitEmptyUnicodeString(&strDriverName, acwBuffer, sizeof(acwBuffer));
344 
345  /* Start path with systemroot */
346  RtlAppendUnicodeToString(&strDriverName, L"\\SystemRoot\\System32\\");
347 
348  /* Get Length of given string */
349  cwcLength = wcslen(pwszDriverName);
350 
351  /* Check if we have a system32 path given */
352  pwsz = pwszDriverName + cwcLength;
353  while (pwsz > pwszDriverName)
354  {
355  if ((*pwsz == L'\\') && (_wcsnicmp(pwsz, L"\\system32\\", 10) == 0))
356  {
357  /* Driver name starts after system32 */
358  pwsz += 10;
359  break;
360  }
361  pwsz--;
362  }
363 
364  /* Append the driver name */
365  RtlAppendUnicodeToString(&strDriverName, pwsz);
366 
367  /* MSDN says "The driver must include this suffix in the pwszDriver string."
368  But in fact it's optional. The function can also load .sys files without
369  appending the .dll extension. */
370  if ((cwcLength < 4) ||
371  ((_wcsnicmp(pwszDriverName + cwcLength - 4, L".dll", 4) != 0) &&
372  (_wcsnicmp(pwszDriverName + cwcLength - 4, L".sys", 4) != 0)) )
373  {
374  /* Append the .dll suffix */
375  RtlAppendUnicodeToString(&strDriverName, L".dll");
376  }
377 
378  /* Lock loader */
380 
381  /* Search the List of LDEVS for the driver name */
382  for (pleLink = gleLdevListHead.Flink;
383  pleLink != &gleLdevListHead;
384  pleLink = pleLink->Flink)
385  {
386  pldev = CONTAINING_RECORD(pleLink, LDEVOBJ, leLink);
387 
388  /* Check if the ldev is associated with a file */
389  if (pldev->pGdiDriverInfo)
390  {
391  /* Check for match (case insensative) */
392  if (RtlEqualUnicodeString(&pldev->pGdiDriverInfo->DriverName, &strDriverName, TRUE))
393  {
394  /* Image found in LDEV list */
395  break;
396  }
397  }
398  }
399 
400  /* Did we find one? */
401  if (pleLink == &gleLdevListHead)
402  {
403  /* No, allocate a new LDEVOBJ */
404  pldev = LDEVOBJ_AllocLDEV(ldevtype);
405  if (!pldev)
406  {
407  ERR("Could not allocate LDEV\n");
408  goto leave;
409  }
410 
411  /* Load the image */
412  if (!LDEVOBJ_bLoadImage(pldev, &strDriverName))
413  {
414  LDEVOBJ_vFreeLDEV(pldev);
415  pldev = NULL;
416  ERR("LDEVOBJ_bLoadImage failed\n");
417  goto leave;
418  }
419 
420  /* Shall we load a driver? */
421  if (ldevtype != LDEV_IMAGE)
422  {
423  /* Load the driver */
424  if (!LDEVOBJ_bEnableDriver(pldev))
425  {
426  ERR("LDEVOBJ_bEnableDriver failed\n");
427 
428  /* Unload the image. */
429  LDEVOBJ_vUnloadImage(pldev);
430  LDEVOBJ_vFreeLDEV(pldev);
431  pldev = NULL;
432  goto leave;
433  }
434  }
435 
436  /* Insert the LDEV into the global list */
438  }
439 
440  /* Increase ref count */
441  pldev->cRefs++;
442 
443 leave:
444  /* Unlock loader */
446 
447  TRACE("EngLoadImageEx returning %p\n", pldev);
448  return pldev;
449 }
450 
451 
454 HANDLE
455 APIENTRY
457  _In_ LPWSTR pwszDriverName)
458 {
459  return (HANDLE)EngLoadImageEx(pwszDriverName, LDEV_IMAGE);
460 }
461 
462 
463 VOID
464 APIENTRY
467 {
468  PLDEVOBJ pldev = (PLDEVOBJ)hModule;
469 
470  /* Make sure the LDEV is in the list */
471  ASSERT((pldev->leLink.Flink != NULL) && (pldev->leLink.Blink != NULL));
472 
473  /* Lock loader */
475 
476  /* Decrement reference count */
477  pldev->cRefs--;
478 
479  /* No more references left? */
480  if (pldev->cRefs == 0)
481  {
482  /* Remove ldev from the list */
483  RemoveEntryList(&pldev->leLink);
484 
485  /* Unload the image and free the LDEV */
486  LDEVOBJ_vUnloadImage(pldev);
487  LDEVOBJ_vFreeLDEV(pldev);
488  }
489 
490  /* Unlock loader */
492 }
493 
494 
495 PVOID
496 APIENTRY
499  _In_ LPSTR lpProcName)
500 {
501  PLDEVOBJ pldev = (PLDEVOBJ)hModule;
502 
504 
505  /* Check if win32k is requested */
506  if (!pldev)
507  {
508  pldev = gpldevWin32k;
509  }
510 
511  /* Check if the drivers entry point is requested */
512  if (_strnicmp(lpProcName, "DrvEnableDriver", 15) == 0)
513  {
514  return pldev->pGdiDriverInfo->EntryPoint;
515  }
516 
517  /* Try to find the address */
518  return LDEVOBJ_pvFindImageProcAddress(pldev, lpProcName);
519 }
520 
521 /* EOF */
#define GDITAG_LDEV
Definition: tags.h:135
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
ULONG iFunc
Definition: winddi.h:530
DBG_DEFAULT_CHANNEL(EngLDev)
#define TRUE
Definition: types.h:120
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define GDITAG_DEVMODE
Definition: tags.h:73
static VOID LDEVOBJ_vFreeLDEV(_In_ _Post_ptr_invalid_ PLDEVOBJ pldev)
Definition: ldevobj.c:103
PDEVMODEINFO NTAPI LDEVOBJ_pdmiGetModes(_In_ PLDEVOBJ pldev, _In_ HANDLE hDriver)
Definition: ldevobj.c:116
uint16_t * PWSTR
Definition: typedefs.h:54
struct _LIST_ENTRY * Blink
Definition: typedefs.h:120
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
LONG NTSTATUS
Definition: precomp.h:26
static BOOL LDEVOBJ_bEnableDriver(_Inout_ PLDEVOBJ pldev)
Definition: ldevobj.c:248
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO _In_ HDEV _In_ LPWSTR _In_ HANDLE hDriver
Definition: winddi.h:3553
char * LPSTR
Definition: xmlstorage.h:182
static PVOID LDEVOBJ_pvFindImageProcAddress(_In_ PLDEVOBJ pldev, _In_z_ LPSTR pszProcName)
Definition: ldevobj.c:282
#define _stricmp
Definition: cat.c:22
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
DWORD AddressOfNameOrdinals
Definition: compat.h:155
PFN pfn
Definition: winddi.h:531
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
PLDEVOBJ NTAPI EngLoadImageEx(_In_z_ LPWSTR pwszDriverName, _In_ ULONG ldevtype)
Definition: ldevobj.c:328
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
Definition: glfuncs.h:248
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
static HSEMAPHORE ghsemLDEVList
Definition: ldevobj.c:20
unsigned int BOOL
Definition: ntddk_ex.h:94
static const unsigned GDI_ENGINE_VERSION
Definition: ldevobj.h:4
_Check_return_ _CRTIMP int __cdecl _strnicmp(_In_reads_or_z_(_MaxCount) const char *_Str1, _In_reads_or_z_(_MaxCount) const char *_Str2, _In_ size_t _MaxCount)
ULONG cbdevmode
Definition: pdevobj.h:46
static VOID LDEVOBJ_vUnloadImage(_Inout_ PLDEVOBJ pldev)
Definition: ldevobj.c:217
ENGAPI VOID APIENTRY EngAcquireSemaphore(_Inout_ HSEMAPHORE hsem)
FN_DrvEnableDriver * PFN_DrvEnableDriver
Definition: winddi.h:3542
smooth NULL
Definition: ftsmooth.c:416
void * PVOID
Definition: retypes.h:9
static LDEVOBJ * gpldevWin32k
Definition: ldevobj.c:22
static LIST_ENTRY gleLdevListHead
Definition: ldevobj.c:21
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
DEVMODEW adevmode[1]
Definition: pdevobj.h:47
VOID APIENTRY EngUnloadImage(_In_ HANDLE hModule)
Definition: ldevobj.c:465
SYSTEM_GDI_DRIVER_INFORMATION * pGdiDriverInfo
Definition: ldevobj.h:19
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
INIT_FUNCTION NTSTATUS NTAPI InitLDEVImpl(VOID)
Definition: ldevobj.c:30
#define TRACE(s)
Definition: solgame.cpp:4
DWORD_PTR HSEMAPHORE
Definition: axcore.idl:60
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static PLDEVOBJ LDEVOBJ_AllocLDEV(_In_ LDEVTYPE ldevtype)
Definition: ldevobj.c:79
#define MAX_PATH
Definition: compat.h:26
#define _Inout_
Definition: no_sal2.h:244
DRVFN * pdrvfn
Definition: winddi.h:544
NTSYSAPI NTSTATUS NTAPI ZwSetSystemInformation(_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass, _In_ PVOID SystemInformation, _In_ SIZE_T SystemInformationLength)
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
HANDLE APIENTRY EngLoadImage(_In_ LPWSTR pwszDriverName)
Definition: ldevobj.c:456
static const WCHAR L[]
Definition: oid.c:1250
#define RtlImageDirectoryEntryToData
Definition: compat.h:460
LDEVTYPE
Definition: ldevobj.h:6
Definition: typedefs.h:117
#define IMAGE_DIRECTORY_ENTRY_EXPORT
Definition: compat.h:140
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
#define _In_
Definition: no_sal2.h:204
#define SystemLoadGdiDriverInformation
Definition: DriverTester.h:34
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define _Post_ptr_invalid_
Definition: no_sal2.h:462
PVOID APIENTRY EngFindImageProcAddress(_In_ HANDLE hModule, _In_ LPSTR lpProcName)
Definition: ldevobj.c:497
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
#define _In_z_
Definition: no_sal2.h:239
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
ULONG iDriverVersion
Definition: winddi.h:542
unsigned int * PULONG
Definition: retypes.h:1
static BOOL LDEVOBJ_bLoadImage(_Inout_ PLDEVOBJ pldev, _In_ PUNICODE_STRING pustrPathName)
Definition: ldevobj.c:168
ULONG ulDriverVersion
Definition: ldevobj.h:22
struct _SYSTEM_GDI_DRIVER_INFORMATION SYSTEM_GDI_DRIVER_INFORMATION
struct _LDEVOBJ * PLDEVOBJ
#define RVA_TO_ADDR(Base, Rva)
Definition: ldevobj.c:15
HSEMAPHORE WINAPI EngCreateSemaphore(VOID)
Definition: eng.c:75
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
LDEVTYPE ldevtype
Definition: ldevobj.h:20
LIST_ENTRY leLink
Definition: ldevobj.h:18
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define __ImageBase
Definition: crt_handler.c:22
WCHAR * LPWSTR
Definition: xmlstorage.h:184
return STATUS_SUCCESS
Definition: btrfs.c:2725
struct _LDEVOBJ * pldev
Definition: pdevobj.h:45
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PIMAGE_EXPORT_DIRECTORY ExportSectionPointer
Definition: DriverTester.h:49
unsigned short * PUSHORT
Definition: retypes.h:2
#define APIENTRY
Definition: api.h:79
HMODULE hModule
Definition: animate.c:44
ULONG cRefs
Definition: ldevobj.h:21