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.

123 lines
2.7 KiB

  1. //#define DBCS
  2. #ifndef WIN32_LEAN_AND_MEAN
  3. #define WIN32_LEAN_AND_MEAN
  4. #endif
  5. #include <windows.h>
  6. #include <regstr.h>
  7. #include <string.h>
  8. #include <netlib.h>
  9. #ifdef DEBUG
  10. #define SAVE_DEBUG
  11. #undef DEBUG
  12. #endif
  13. #include <npstring.h>
  14. #include <npdefs.h>
  15. #ifdef SAVE_DEBUG
  16. #define DEBUG
  17. #endif
  18. #if DBG
  19. #define DEBUG 1
  20. #endif
  21. #include <ole2.h>
  22. #include "ratguid.h"
  23. #include <ccstock.h>
  24. #ifdef ENTERCRITICAL
  25. #undef ENTERCRITICAL
  26. #endif // ENTERCRITICAL
  27. #ifdef LEAVECRITICAL
  28. #undef LEAVECRITICAL
  29. #endif // LEAVECRITICAL
  30. #ifdef ASSERTCRITICAL
  31. #undef ASSERTCRITICAL
  32. #endif // ASSERTCRITICAL
  33. #ifndef MAXPATHLEN
  34. #define MAXPATHLEN MAX_PATH
  35. #endif
  36. void Netlib_EnterCriticalSection(void);
  37. void Netlib_LeaveCriticalSection(void);
  38. #ifdef DEBUG
  39. extern BOOL g_fCritical;
  40. #endif
  41. #define ENTERCRITICAL Netlib_EnterCriticalSection();
  42. #define LEAVECRITICAL Netlib_LeaveCriticalSection();
  43. #define ASSERTCRITICAL ASSERT(g_fCritical);
  44. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  45. #define DATASEG_PERINSTANCE ".instance"
  46. #define DATASEG_SHARED ".data"
  47. #define DATASEG_DEFAULT DATASEG_SHARED
  48. #pragma data_seg(DATASEG_PERINSTANCE)
  49. extern HINSTANCE g_hInstance;
  50. // Set the default data segment
  51. #pragma data_seg(DATASEG_DEFAULT)
  52. extern "C" {
  53. HRESULT VerifySupervisorPassword(LPCSTR pszPassword = NULL);
  54. HRESULT ChangeSupervisorPassword(LPCSTR pszOldPassword, LPCSTR pszNewPassword);
  55. HRESULT RemoveSupervisorPassword(void);
  56. };
  57. #define RATINGS_MAX_PASSWORD_LENGTH 256
  58. const UINT cchMaxUsername = 128;
  59. extern long g_cRefThisDll;
  60. extern long g_cLocks;
  61. extern void LockThisDLL(BOOL fLock);
  62. extern void RefThisDLL(BOOL fRef);
  63. extern void CleanupWinINet(void);
  64. extern void CleanupOLE(void);
  65. extern void InitRatingHelpers();
  66. extern void CleanupRatingHelpers();
  67. class CLUClassFactory : public IClassFactory
  68. {
  69. public:
  70. STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
  71. STDMETHODIMP_(ULONG) AddRef(void);
  72. STDMETHODIMP_(ULONG) Release(void);
  73. STDMETHODIMP CreateInstance(
  74. /* [unique][in] */ IUnknown __RPC_FAR *pUnkOuter,
  75. /* [in] */ REFIID riid,
  76. /* [out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
  77. STDMETHODIMP LockServer(
  78. /* [in] */ BOOL fLock);
  79. };
  80. #include <commctrl.h>
  81. #include <shfusion.h>
  82. // ATL
  83. #ifndef _WIN32_WINNT
  84. #define _WIN32_WINNT 0x0400
  85. #endif
  86. #define _ATL_APARTMENT_THREADED
  87. #include <atlbase.h>
  88. //You may derive a class from CComModule and use it if you want to override
  89. //something, but do not change the name of _Module
  90. extern CComModule _Module;
  91. #include <atlcom.h>
  92. // WTL
  93. #include <atlapp.h>
  94. #include <atlwin.h>
  95. #include <atldlgs.h>