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.

125 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. StdAfx.h
  5. Abstract:
  6. This module contains the definitions for the base
  7. ATL methods.
  8. Author:
  9. Don Dumitru (dondu@microsoft.com)
  10. Revision History:
  11. dondu 12/04/96 created
  12. --*/
  13. // stdafx.h : include file for standard system include files,
  14. // or project specific include files that are used frequently,
  15. // but are changed infrequently
  16. #ifndef _WIN32_WINNT
  17. #define _WIN32_WINNT 0x0400
  18. #endif
  19. #ifdef _ATL_NO_DEBUG_CRT
  20. #include "windows.h"
  21. #include "dbgtrace.h"
  22. #define _ASSERTE _ASSERT
  23. #endif
  24. //#define _ATL_APARTMENT_THREADED
  25. #include <atlbase.h>
  26. //You may derive a class from CComModule and use it if you want to override
  27. //something, but do not change the name of _Module
  28. class CSEOComModule : public CComModule {
  29. public:
  30. const GUID *GetAPPID();
  31. HRESULT WriteAPPID();
  32. HRESULT EraseAPPID();
  33. };
  34. extern CSEOComModule _Module;
  35. #include <atlcom.h>
  36. #if defined(_ATL_SINGLE_THREADED)
  37. #define ATL_THREADING_MODEL_VALUE L"Single"
  38. #elif defined(_ATL_APARTMENT_THREADED)
  39. #define ATL_THREADING_MODEL_VALUE L"Apartment"
  40. #else
  41. #define ATL_THREADING_MODEL_VALUE L"Both"
  42. #endif
  43. #define DECLARE_REGISTRY_RESOURCEID_EX(x,desc,progid,viprogid) \
  44. static HRESULT WINAPI UpdateRegistry(BOOL bRegister) { \
  45. HRESULT hrRes; \
  46. _ATL_REGMAP_ENTRY *parme; \
  47. \
  48. hrRes = AtlAllocRegMapEx(&parme, \
  49. &GetObjectCLSID(), \
  50. &_Module, \
  51. NULL, \
  52. L"DESCRIPTION", \
  53. desc, \
  54. L"PROGID", \
  55. progid, \
  56. L"VIPROGID", \
  57. viprogid, \
  58. L"THREADINGMODEL", \
  59. ATL_THREADING_MODEL_VALUE, \
  60. NULL, \
  61. NULL); \
  62. if (!SUCCEEDED(hrRes)) { \
  63. return (hrRes); \
  64. } \
  65. hrRes = _Module.UpdateRegistryFromResource(x,bRegister,parme); \
  66. CoTaskMemFree(parme); \
  67. return (hrRes); \
  68. }
  69. #define DECLARE_REGISTRY_RESOURCE_EX(x,desc,progid,viprogid) \
  70. static HRESULT WINAPI UpdateRegistry(BOOL bRegister) { \
  71. HRESULT hrRes; \
  72. _ATL_REGMAP_ENTRY *parme; \
  73. \
  74. hrRes = AtlAllocRegMapEx(&parme, \
  75. &GetObjectCLSID(), \
  76. &_Module, \
  77. NULL, \
  78. L"DESCRIPTION", \
  79. desc, \
  80. L"PROGID", \
  81. progid, \
  82. L"VIPROGID", \
  83. viprogid, \
  84. L"THREADINGMODEL", \
  85. ATL_THREADING_MODEL_VALUE, \
  86. NULL, \
  87. NULL); \
  88. if (!SUCCEEDED(hrRes)) { \
  89. return (hrRes); \
  90. } \
  91. hrRes = _Module.UpdateRegistryFromResource(_T(#x),bRegister,parme); \
  92. CoTaskMemFree(parme); \
  93. return (hrRes); \
  94. }
  95. HRESULT AtlAllocRegMapEx(_ATL_REGMAP_ENTRY **pparmeResult,
  96. const CLSID *pclsid,
  97. CSEOComModule *pmodule,
  98. LPCOLESTR pszIndex,
  99. ...);