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.

87 lines
2.3 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CFactory.h
  7. //
  8. // Description:
  9. // Class Factory implementation.
  10. //
  11. // Maintained By:
  12. // Geoffrey Pease (GPease) 22-NOV-1999
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. #pragma once
  16. #define CCH(sz) (sizeof(sz)/sizeof(sz[0]))
  17. //
  18. // DLL Globals
  19. //
  20. extern HINSTANCE g_hInstance;
  21. extern LONG g_cObjects;
  22. extern LONG g_cLock;
  23. extern WCHAR g_szDllFilename[ MAX_PATH ];
  24. extern LPVOID g_GlobalMemoryList; // Global memory tracking list
  25. #define DllExport __declspec( dllimport )
  26. #define SCRIPTRES_RESTYPE_NAME L"ScriptRes"
  27. //
  28. // Class Definitions for DLLGetClassObject
  29. //
  30. typedef LPUNKNOWN (*LPCREATEINST)();
  31. typedef struct _ClassTable {
  32. LPCREATEINST pfnCreateInstance; // creation function for class
  33. const CLSID * rclsid; // classes in this DLL
  34. LPCTSTR pszName; // Class name for debugging
  35. LPCTSTR pszComModel; // String indicating COM threading model
  36. } CLASSTABLE[], *LPCLASSTABLE;
  37. //
  38. // Class Table Macros
  39. //
  40. #define BEGIN_CLASSTABLE const CLASSTABLE g_DllClasses = {
  41. #define DEFINE_CLASS( _pfn, _riid, _name, _model ) { _pfn, &_riid, TEXT(_name), TEXT(_model) },
  42. #define END_CLASSTABLE { NULL, NULL, NULL, NULL } };
  43. extern const CLASSTABLE g_DllClasses;
  44. //
  45. // DLL required headers
  46. //
  47. #include <Debug.h> // debugging
  48. #include <CITracker.h>
  49. #if defined( _X86_ ) && defined( TRACE_INTERFACES_ENABLED )
  50. //
  51. // DLL Interface Table Macros
  52. //
  53. #define BEGIN_INTERFACETABLE const INTERFACE_TABLE g_itTable = {
  54. #define DEFINE_INTERFACE( _iid, _name, _count ) { &_iid, TEXT(_name), _count },
  55. #define END_INTERFACETABLE { NULL, NULL, NULL } };
  56. #endif // TRACE_INTERFACES_ENABLED
  57. //
  58. // DLL Useful Macros
  59. //
  60. #define PtrToByteOffset(base, offset) (((LPBYTE)base)+offset)
  61. #define STATUS_TO_RETURN( _hr ) \
  62. ( ( HRESULT_FACILITY( _hr ) == FACILITY_WIN32 ) ? HRESULT_CODE( _hr ) : _hr )
  63. //
  64. // DLL Global Function Prototypes
  65. //
  66. HRESULT
  67. HrClusCoCreateInstance(
  68. REFCLSID rclsidIn,
  69. LPUNKNOWN pUnkOuterIn,
  70. DWORD dwClsContextIn,
  71. REFIID riidIn,
  72. LPVOID * ppvOut
  73. );