Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
2.8 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Copyright (c) 1999-2001 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // Module Name:
  6. //
  7. // commonfiles.h
  8. //
  9. // Abstract:
  10. //
  11. //
  12. // Environment:
  13. //
  14. // Windows NT 5.0 Unidrv driver
  15. //
  16. /////////////////////////////////////////////////////////////////////////////
  17. #ifndef COMMONFILES_H
  18. #define COMMONFILES_H
  19. //
  20. // To build an NT 4.0 render module:
  21. // define KERNEL_MODE and undefine USERMODE_DRIVER
  22. // To build an NT 5.0 render module:
  23. // define KERNEL_MODE and define USERMODE_DRIVER
  24. // To build an NT 4.0 and NT 5.0 UI module:
  25. // undefine KERNEL_MODE and undefine USERMODE_DRIVER
  26. //
  27. ////// #include <tchar.h>
  28. //
  29. // windows include files
  30. //
  31. #include <stddef.h>
  32. #include <stdio.h>
  33. #include <stdlib.h>
  34. #ifdef OEMCOM
  35. #include <objbase.h>
  36. #endif
  37. #include <stdarg.h>
  38. #include <windef.h>
  39. #include <winerror.h>
  40. #include <winbase.h>
  41. #include <wingdi.h>
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. #include <winddi.h>
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #include <excpt.h>
  50. #if defined(KERNEL_MODE) && !defined(USERMODE_DRIVER)
  51. #include "winsplkm.h"
  52. #elif !defined(KERNEL_MODE)// !KERNEL_MODE
  53. #include <windows.h>
  54. #include <winspool.h>
  55. #include <stdio.h>
  56. #include <compstui.h>
  57. #include <winddiui.h>
  58. #endif // defined(KERNEL_MODE) && !defined(USERMODE_DRIVER)
  59. #include <printoem.h>
  60. #include "gldebug.h"
  61. //
  62. // Directory seperator character
  63. //
  64. #define PATH_SEPARATOR '\\'
  65. #if defined(KERNEL_MODE) && !defined(USERMODE_DRIVER)
  66. //#define WritePrinter EngWritePrinter
  67. //#define GetPrinterDriver EngGetPrinterDriver
  68. //#define GetPrinterData EngGetPrinterData
  69. //#define SetPrinterData EngSetPrinterData
  70. //#define EnumForms EngEnumForms
  71. //#define GetPrinter EngGetPrinter
  72. //#define GetForm EngGetForm
  73. //#define SetLastError EngSetLastError
  74. //#define GetLastError EngGetLastError
  75. //#define MulDiv EngMulDiv
  76. //#undef LoadLibrary
  77. //#define LoadLibrary EngLoadImage
  78. //#define FreeLibrary EngUnloadImage
  79. //#define GetProcAddress EngFindImageProcAddress
  80. #define MemAlloc(size) EngAllocMem(0, size, gdwDrvMemPoolTag)
  81. #define MemAllocZ(size) EngAllocMem(FL_ZERO_MEMORY, size, gdwDrvMemPoolTag)
  82. #define MemFree(p) { if (p) EngFreeMem(p); }
  83. #else // !KERNEL_MODE
  84. #define MemAlloc(size) ((PVOID) LocalAlloc(LMEM_FIXED, (size)))
  85. #define MemAllocZ(size) ((PVOID) LocalAlloc(LPTR, (size)))
  86. #define MemFree(p) { if (p) LocalFree((HLOCAL) (p)); }
  87. //
  88. // DLL instance handle - You must initialize this variable when the driver DLL
  89. // is attached to a process.
  90. //
  91. // BUGBUG -sandram do we need this var?
  92. //extern HINSTANCE ghInstance;
  93. #endif // !KERNEL_MODE
  94. #endif