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.

214 lines
6.3 KiB

  1. #ifndef _CABINET_H
  2. #define _CABINET_H
  3. #include <w4warn.h>
  4. /*
  5. * Level 4 warnings to be turned on.
  6. * Do not disable any more level 4 warnings.
  7. */
  8. #pragma warning(disable:4127) // conditional expression is constant
  9. #pragma warning(disable:4189) // 'fIoctlSuccess' : local variable is initialized but not referenced
  10. #pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
  11. #pragma warning(disable:4245) // conversion signed/unsigned mismatch
  12. #pragma warning(disable:4509) // nonstandard extension used: 'GetUserAssist' uses SEH and 'debug_crit' has destructor
  13. #pragma warning(disable:4701) // local variable 'hfontOld' may be used without having been initialized
  14. #pragma warning(disable:4706) // assignment within conditional expression
  15. #pragma warning(disable:4328) // indirection alignment of formal parameter 1(4) is greater than the actual argument alignment (1)
  16. #define _WINMM_ // for DECLSPEC_IMPORT
  17. #define STRICT
  18. #define OEMRESOURCE
  19. #define OVERRIDE_SHLWAPI_PATH_FUNCTIONS // see comment in shsemip.h
  20. #ifdef WINNT
  21. #include <nt.h> // Some of the NT specific code calls Rtl functions
  22. #include <ntrtl.h> // which requires all of these header files...
  23. #include <nturtl.h>
  24. #endif
  25. #include <windows.h>
  26. #include <commctrl.h>
  27. #include <shfusion.h>
  28. #include <msginaexports.h>
  29. // if you include atlstuff.h, you don't get windowsx.h. so we define needed functions here
  30. __inline HBRUSH SelectBrush(HDC hdc, HBRUSH hbr) { return (HBRUSH)SelectObject(hdc, (HGDIOBJ)(HBRUSH)hbr); }
  31. __inline HFONT SelectFont(HDC hdc, HFONT hfont) { return (HFONT)SelectObject(hdc, (HGDIOBJ)(HFONT)hfont); }
  32. __inline HBITMAP SelectBitmap(HDC hdc, HBITMAP hbm) { return (HBITMAP)SelectObject(hdc, (HGDIOBJ)(HBITMAP)hbm); }
  33. __inline WNDPROC SubclassWindow(HWND hwnd, WNDPROC lpfn) { return (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LPARAM)lpfn); }
  34. #include <windowsx.h>
  35. #include <ole2.h>
  36. #include <wininet.h>
  37. #include <shlobj.h> // Includes <fcext.h>
  38. #include <shsemip.h>
  39. #include <shellapi.h>
  40. #include <cpl.h>
  41. #include <ddeml.h>
  42. #include <cfgmgr32.h>
  43. #ifdef UNICODE
  44. #define CP_WINNATURAL CP_WINUNICODE
  45. #else
  46. #define CP_WINNATURAL CP_WINANSI
  47. #endif
  48. #define DISALLOW_Assert
  49. #include <debug.h> // our version of Assert etc.
  50. #include <port32.h>
  51. #include <heapaloc.h>
  52. #include <shellp.h>
  53. #include <ccstock.h>
  54. #include <shlobjp.h>
  55. #include <shlwapi.h>
  56. #include "dbt.h"
  57. #include "trayp.h"
  58. #include <shdocvw.h>
  59. #include <uxtheme.h>
  60. #include <tmschema.h>
  61. #include <runonce.h>
  62. #include "shguidp.h"
  63. #include "ieguidp.h"
  64. #include "shdguid.h"
  65. #include "uastrfnc.h"
  66. #include <desktopp.h>
  67. //
  68. // Trace/dump/break flags specific to explorer.
  69. // (Standard flags defined in shellp.h)
  70. //
  71. // Trace flags
  72. #define TF_DDE 0x00000100 // DDE traces
  73. #define TF_TARGETFRAME 0x00000200 // Target frame
  74. #define TF_TRAYDOCK 0x00000400 // Tray dock
  75. #define TF_TRAY 0x00000800 // Tray
  76. // "Olde names"
  77. #define DM_DDETRACE TF_DDE
  78. #define DM_TARGETFRAME TF_TARGETFRAME
  79. #define DM_TRAYDOCK TF_TRAYDOCK
  80. // Function trace flags
  81. #define FTF_DDE 0x00000001 // DDE functions
  82. #define FTF_TARGETFRAME 0x00000002 // Target frame methods
  83. // Dump flags
  84. #define DF_DDE 0x00000001 // DDE package
  85. #define DF_DELAYLOADDLL 0x00000002 // Delay load
  86. #ifdef __cplusplus
  87. extern "C" { /* Assume C declarations for C++ */
  88. #endif /* __cplusplus */
  89. //---------------------------------------------------------------------------
  90. // Globals
  91. extern HINSTANCE hinstCabinet; // Instance handle of the app.
  92. extern HWND v_hwndDesktop;
  93. extern HKEY g_hkeyExplorer;
  94. //
  95. // Is Mirroring APIs enabled (BiDi Memphis and NT5 only)
  96. //
  97. extern BOOL g_bMirroredOS;
  98. // Global System metrics. the desktop wnd proc will be responsible
  99. // for watching wininichanges and keeping these up to date.
  100. extern int g_fCleanBoot;
  101. extern BOOL g_fFakeShutdown;
  102. extern int g_fDragFullWindows;
  103. extern int g_cxEdge;
  104. extern int g_cyEdge;
  105. extern int g_cySize;
  106. extern int g_cyTabSpace;
  107. extern int g_cxTabSpace;
  108. extern int g_cxBorder;
  109. extern int g_cyBorder;
  110. extern int g_cxPrimaryDisplay;
  111. extern int g_cyPrimaryDisplay;
  112. extern int g_cxDlgFrame;
  113. extern int g_cyDlgFrame;
  114. extern int g_cxFrame;
  115. extern int g_cyFrame;
  116. extern int g_cxMinimized;
  117. extern int g_cxVScroll;
  118. extern int g_cyHScroll;
  119. extern BOOL g_fNoDesktop;
  120. extern UINT g_uDoubleClick;
  121. extern HWND v_hwndTray;
  122. extern HWND v_hwndStartPane;
  123. extern BOOL g_fDesktopRaised;
  124. extern const WCHAR c_wzTaskbarTheme[];
  125. // the order of these is IMPORTANT for move-tracking and profile stuff
  126. // also for the STUCK_HORIZONTAL macro
  127. #define STICK_FIRST ABE_LEFT
  128. #define STICK_LEFT ABE_LEFT
  129. #define STICK_TOP ABE_TOP
  130. #define STICK_RIGHT ABE_RIGHT
  131. #define STICK_BOTTOM ABE_BOTTOM
  132. #define STICK_LAST ABE_BOTTOM
  133. #define STICK_MAX ABE_MAX
  134. #define STUCK_HORIZONTAL(x) (x & 0x1)
  135. #if STUCK_HORIZONTAL(STICK_LEFT) || STUCK_HORIZONTAL(STICK_RIGHT) || \
  136. !STUCK_HORIZONTAL(STICK_TOP) || !STUCK_HORIZONTAL(STICK_BOTTOM)
  137. #error Invalid STICK_* constants
  138. #endif
  139. #define IsValidSTUCKPLACE(stick) IsInRange(stick, STICK_FIRST, STICK_LAST)
  140. // initcab.cpp
  141. HKEY GetSessionKey(REGSAM samDesired);
  142. void RunStartupApps();
  143. void WriteCleanShutdown(DWORD dwValue);
  144. //
  145. // Debug helper functions
  146. //
  147. void InvokeURLDebugDlg(HWND hwnd);
  148. void Cabinet_InitGlobalMetrics(WPARAM, LPTSTR);
  149. #define REGSTR_PATH_ADVANCED REGSTR_PATH_EXPLORER TEXT("\\Advanced")
  150. #define REGSTR_PATH_SMADVANCED REGSTR_PATH_EXPLORER TEXT("\\StartMenu")
  151. #define REGSTR_PATH_RUN_POLICY REGSTR_PATH_POLICIES TEXT("\\Explorer\\Run")
  152. #define REGSTR_EXPLORER_ADVANCED REGSTR_PATH_ADVANCED
  153. #define REGSTR_POLICIES_EXPLORER TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer")
  154. #undef WinHelp
  155. #define WinHelp SHWinHelp
  156. #ifdef __cplusplus
  157. }; /* End of extern "C" { */
  158. #endif // __cplusplus
  159. #define PERF_ENABLESETMARK
  160. #ifdef PERF_ENABLESETMARK
  161. void DoSetMark(LPCSTR pszMark, ULONG cbSz);
  162. #define PERFSETMARK(text) DoSetMark(text, sizeof(text))
  163. #else
  164. #define PERFSETMARK(text)
  165. #endif // PERF_ENABLESETMARK
  166. #endif // _CABINET_H