///////////////////////////////////////////////////////////////////////////// // Copyright (c) 1999-2001 Microsoft Corporation // All rights reserved. // // Module Name: // // commonfiles.h // // Abstract: // // // Environment: // // Windows NT 5.0 Unidrv driver // ///////////////////////////////////////////////////////////////////////////// #ifndef COMMONFILES_H #define COMMONFILES_H // // To build an NT 4.0 render module: // define KERNEL_MODE and undefine USERMODE_DRIVER // To build an NT 5.0 render module: // define KERNEL_MODE and define USERMODE_DRIVER // To build an NT 4.0 and NT 5.0 UI module: // undefine KERNEL_MODE and undefine USERMODE_DRIVER // ////// #include // // windows include files // #include #include #include #ifdef OEMCOM #include #endif #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif #include #ifdef __cplusplus } #endif #include #if defined(KERNEL_MODE) && !defined(USERMODE_DRIVER) #include "winsplkm.h" #elif !defined(KERNEL_MODE)// !KERNEL_MODE #include #include #include #include #include #endif // defined(KERNEL_MODE) && !defined(USERMODE_DRIVER) #include #include "gldebug.h" // // Directory seperator character // #define PATH_SEPARATOR '\\' #if defined(KERNEL_MODE) && !defined(USERMODE_DRIVER) //#define WritePrinter EngWritePrinter //#define GetPrinterDriver EngGetPrinterDriver //#define GetPrinterData EngGetPrinterData //#define SetPrinterData EngSetPrinterData //#define EnumForms EngEnumForms //#define GetPrinter EngGetPrinter //#define GetForm EngGetForm //#define SetLastError EngSetLastError //#define GetLastError EngGetLastError //#define MulDiv EngMulDiv //#undef LoadLibrary //#define LoadLibrary EngLoadImage //#define FreeLibrary EngUnloadImage //#define GetProcAddress EngFindImageProcAddress #define MemAlloc(size) EngAllocMem(0, size, gdwDrvMemPoolTag) #define MemAllocZ(size) EngAllocMem(FL_ZERO_MEMORY, size, gdwDrvMemPoolTag) #define MemFree(p) { if (p) EngFreeMem(p); } #else // !KERNEL_MODE #define MemAlloc(size) ((PVOID) LocalAlloc(LMEM_FIXED, (size))) #define MemAllocZ(size) ((PVOID) LocalAlloc(LPTR, (size))) #define MemFree(p) { if (p) LocalFree((HLOCAL) (p)); } // // DLL instance handle - You must initialize this variable when the driver DLL // is attached to a process. // // BUGBUG -sandram do we need this var? //extern HINSTANCE ghInstance; #endif // !KERNEL_MODE #endif