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.

70 lines
1.7 KiB

  1. //
  2. // Copyright 1997 - Microsoft
  3. //
  4. //
  5. // DLL.H - DLL globals
  6. //
  7. #ifndef _DLL_H_
  8. #define _DLL_H_
  9. extern HINSTANCE g_hInstance;
  10. extern DWORD g_cObjects;
  11. extern DWORD g_cLock;
  12. extern UINT g_cfDsObjectNames;
  13. extern UINT g_cfDsDisplaySpecOptions;
  14. extern UINT g_cfDsPropetyPageInfo;
  15. extern UINT g_cfMMCGetNodeType;
  16. extern WCHAR g_szDllFilename[ MAX_PATH ];
  17. extern WCHAR g_cszHelpFile[];
  18. #define DllExport __declspec( dllimport )
  19. //
  20. // Thread-safe inc/decrements macros.
  21. //
  22. extern CRITICAL_SECTION g_InterlockCS;
  23. #define InterlockDecrement( _var ) {\
  24. EnterCriticalSection( &g_InterlockCS ); \
  25. --_var;\
  26. LeaveCriticalSection( &g_InterlockCS ); \
  27. }
  28. #define InterlockIncrement( _var ) {\
  29. EnterCriticalSection( &g_InterlockCS ); \
  30. ++_var;\
  31. LeaveCriticalSection( &g_InterlockCS ); \
  32. }
  33. //
  34. // Class Definitions
  35. //
  36. typedef void *(*LPCREATEINST)();
  37. typedef struct _ClassTable {
  38. LPCREATEINST pfnCreateInstance; // creation function for class
  39. const CLSID * rclsid; // classes in this DLL
  40. LPCTSTR pszName; // Class name for debugging
  41. } CLASSTABLE[], *LPCLASSTABLE;
  42. //
  43. // Class Table Macros
  44. //
  45. #define BEGIN_CLASSTABLE const CLASSTABLE g_DllClasses = {
  46. #define DEFINE_CLASS( _pfn, _riid, _name ) { _pfn, &_riid, TEXT(_name) },
  47. #define END_CLASSTABLE { NULL, NULL, NULL } };
  48. extern const CLASSTABLE g_DllClasses;
  49. #include "qi.h"
  50. #include "debug.h"
  51. // Macros
  52. #define ARRAYSIZE( _x ) ((UINT) ( sizeof( _x ) / sizeof( _x[ 0 ] ) ))
  53. #define PtrToByteOffset(base, offset) (((LPBYTE)base)+offset)
  54. #endif // _DLL_H_