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.

312 lines
10 KiB

  1. //***************************************************************************
  2. // --- SHELLAPI.W SHSEMIP.H SHLOBJ.W SHOBJIDL.IDL SHLDISP.IDL SHPRIV.IDL ---
  3. // Which header is best for my new API?
  4. //
  5. // SHSEMIP - *AVOID _ALL_ USAGE*, NO EXPORTS, SUPER PRIVATE
  6. // used for very private shell defines.
  7. //
  8. // SHELLAPI - ALL NEW SHELL32 EXPORTS public and private
  9. // used for both public and private exports from shell32
  10. //
  11. // SHLOBJ - *AVOID NEW USAGE*, PREFER OTHER HEADERS
  12. // used primarily for legacy compatibility
  13. //
  14. // SHOBJIDL - ALL NEW SHELL PUBLIC INTERFACES
  15. // primary file for public shell (shell32+) interfaces
  16. //
  17. // SHLDISP - ALL NEW SHELL AUTOMATION INTERFACES
  18. // automation interfaces are always public
  19. //
  20. // SHPRIV - ALL NEW SHELL PRIVATE INTERFACES
  21. // private interfaces used anywhere in the shell
  22. //
  23. //***************************************************************************
  24. #ifndef _SHSEMIP_H_
  25. #define _SHSEMIP_H_
  26. #ifndef LPNTSTR_DEFINED
  27. #define LPNTSTR_DEFINED
  28. typedef UNALIGNED const WCHAR * LPNCWSTR;
  29. typedef UNALIGNED WCHAR * LPNWSTR;
  30. #ifdef UNICODE
  31. #define LPNCTSTR LPNCWSTR
  32. #define LPNTSTR LPNWSTR
  33. #else
  34. #define LPNCTSTR LPCSTR
  35. #define LPNTSTR LPSTR
  36. #endif
  37. #endif // LPNTSTR_DEFINED
  38. #ifndef DONT_WANT_SHELLDEBUG
  39. #ifndef DebugMsg /* ;Internal */
  40. #define DM_TRACE 0x0001 // Trace messages /* ;Internal */
  41. #define DM_WARNING 0x0002 // Warning /* ;Internal */
  42. #define DM_ERROR 0x0004 // Error /* ;Internal */
  43. #define DM_ASSERT 0x0008 // Assertions /* ;Internal */
  44. #define Assert(f) /* ;Internal */
  45. #define AssertE(f) (f) /* ;Internal */
  46. #define AssertMsg 1 ? (void)0 : (void) /* ;Internal */
  47. #define DebugMsg 1 ? (void)0 : (void) /* ;Internal */
  48. #endif /* ;Internal */
  49. /* ;Internal */
  50. #endif
  51. //
  52. // Define API decoration for direct importing of DLL references.
  53. //
  54. #ifndef WINSHELLAPI
  55. #if !defined(_SHELL32_)
  56. #define WINSHELLAPI DECLSPEC_IMPORT
  57. #else
  58. #define WINSHELLAPI
  59. #endif
  60. #endif // WINSHELLAPI
  61. #ifndef NOPRAGMAS
  62. #ifndef RC_INVOKED
  63. #pragma pack(1) /* Assume byte packing throughout */
  64. #endif /* !RC_INVOKED */
  65. #endif
  66. #ifdef __cplusplus
  67. extern "C" { /* Assume C declarations for C++ */
  68. #endif /* __cplusplus */
  69. //====== Ranges for WM_NOTIFY codes ==================================
  70. // If a new set of codes is defined, make sure the range goes /* ;Internal */
  71. // here so that we can keep them distinct /* ;Internal */
  72. // Note that these are defined to be unsigned to avoid compiler warnings
  73. // since NMHDR.code is declared as UINT.
  74. //
  75. // NM_FIRST - NM_LAST defined in commctrl.h (0U-0U) - (OU-99U)
  76. //
  77. // LVN_FIRST - LVN_LAST defined in commctrl.h (0U-100U) - (OU-199U)
  78. //
  79. // PSN_FIRST - PSN_LAST defined in prsht.h (0U-200U) - (0U-299U)
  80. //
  81. // HDN_FIRST - HDN_LAST defined in commctrl.h (0U-300U) - (OU-399U)
  82. //
  83. // TVN_FIRST - TVN_LAST defined in commctrl.h (0U-400U) - (OU-499U)
  84. // TTN_FIRST - TTN_LAST defined in commctrl.h (0U-520U) - (OU-549U)
  85. #define SEN_FIRST (0U-550U) // ;Internal
  86. #define SEN_LAST (0U-559U) // ;Internal
  87. #ifndef UNIX
  88. #define MAXPATHLEN MAX_PATH // ;Internal
  89. #endif
  90. #ifdef UNICODE
  91. #define OTHER_TCHAR_NAME(sz) sz##A
  92. #else // !UNICODE
  93. #define OTHER_TCHAR_NAME(sz) sz##W
  94. #endif
  95. //===========================================================================
  96. // ITEMIDLIST
  97. //===========================================================================
  98. // unsafe macros
  99. #define _ILSkip(pidl, cb) ((LPITEMIDLIST)(((BYTE*)(pidl))+cb))
  100. #define _ILNext(pidl) _ILSkip(pidl, (pidl)->mkid.cb)
  101. __inline BOOL SHIsConsistentPidl(LPCITEMIDLIST pidl, UINT cbAlloc)
  102. {
  103. // test to make sure that the pidl does not overrun itself
  104. // this is for callers that un-persist pidl data, and
  105. // assumes that the caller knows the allocated size of the pidl
  106. // similar to ILGetSize(pidl) <= cbAlloc except that
  107. // it doesnt assert or throw exceptions
  108. UINT cbPidl = sizeof(pidl->mkid.cb);
  109. while (cbPidl < cbAlloc && pidl->mkid.cb)
  110. {
  111. cbPidl += pidl->mkid.cb;
  112. pidl = _ILNext(pidl);
  113. }
  114. return cbPidl <= cbAlloc && 0 == pidl->mkid.cb;
  115. }
  116. //===================================================================
  117. // Smart tiling API's
  118. WINSHELLAPI WORD WINAPI ArrangeWindows(HWND hwndParent, WORD flags, LPCRECT lpRect, WORD chwnd, const HWND *ahwnd);
  119. /* Avoid multiple typedefs C warnings. Defined in shlapip.h as well. */
  120. #ifndef RUNDLLPROC
  121. typedef void (WINAPI *RUNDLLPROCA)(HWND hwndStub, HINSTANCE hAppInstance, LPSTR lpszCmdLine, int nCmdShow);
  122. typedef void (WINAPI * RUNDLLPROCW)(HWND hwndStub, HINSTANCE hAppInstance, LPWSTR lpszCmdLine, int nCmdShow);
  123. #ifdef UNICODE
  124. #define RUNDLLPROC RUNDLLPROCW
  125. #else
  126. #define RUNDLLPROC RUNDLLPROCA
  127. #endif
  128. #endif
  129. // Maximum length of a path string
  130. #define CCHPATHMAX MAX_PATH
  131. #define MAXSPECLEN MAX_PATH
  132. #define MAX_PATH_URL INTERNET_MAX_URL_LENGTH
  133. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  134. #ifndef SIZEOF
  135. #define SIZEOF(a) sizeof(a)
  136. #endif
  137. #define PathRemoveBlanksORD 33
  138. #define PathFindFileNameORD 34
  139. #define PathFindExtensionORD 31
  140. #ifdef OVERRIDE_SHLWAPI_PATH_FUNCTIONS
  141. // SHLWAPI provides the majority of the Path functions. There are
  142. // some cases where the shell code (shell32 and explorer) need to
  143. // call a different variation of these calls. Because of this, we
  144. // have OVERRIDE_SHLWAPI_PATH_FUNCTIONS. Components such as shdocvw
  145. // should strive to *not* have this defined.
  146. //
  147. // Some reasons why something like shell32 would need this:
  148. // 1) Shell32 calls some WNet APIs due to the NT merge. Shlwapi
  149. // cannot take these.
  150. // 2) Shell32 needs the unaligned version PathBuildRoot,
  151. // PathCombine, etc.
  152. //
  153. #undef PathIsDirectory
  154. #undef PathMakePretty
  155. WINSHELLAPI BOOL WINAPI PathIsDirectory(LPCTSTR lpszPath);
  156. WINSHELLAPI BOOL WINAPI PathMakePretty(LPTSTR lpszPath);
  157. #endif // OVERRIDE_SHLWAPI_PATH_FUNCTIONS
  158. WINSHELLAPI void WINAPI ExitWindowsDialog(HWND hwnd);
  159. WINSHELLAPI void WINAPI LogoffWindowsDialog(HWND hwnd);
  160. WINSHELLAPI void WINAPI DisconnectWindowsDialog(HWND hwnd);
  161. WINSHELLAPI BOOL WINAPI IsSuspendAllowed(void);
  162. WINSHELLAPI void WINAPI SHRefreshSettings(void);
  163. EXTERN_C WINSHELLAPI HRESULT STDAPICALLTYPE SHCopyMonikerToTemp(IMoniker *pmk, LPCWSTR pszIn, LPWSTR pszOut, int cchOut);
  164. WINSHELLAPI BOOL WINAPI IsVolumeNTFS(LPCTSTR pszRootPath);
  165. #ifdef WINNT
  166. WINSHELLAPI LPWSTR WINAPI GetDownlevelCopyDataLossText(LPCWSTR pszSrcFile, LPCWSTR pszDestDir, BOOL bIsADir, BOOL * pbLossPossibleThisDir);
  167. #endif
  168. //-------- file engine stuff ----------
  169. // "current directory" management routines. used to set parameters
  170. // that paths are qualfied against in MoveCopyDeleteRename()
  171. WINSHELLAPI int WINAPI GetDefaultDrive();
  172. WINSHELLAPI int WINAPI SetDefaultDrive(int iDrive);
  173. WINSHELLAPI int WINAPI SetDefaultDirectory(LPCTSTR lpPath);
  174. WINSHELLAPI void WINAPI GetDefaultDirectory(int iDrive, LPSTR lpPath);
  175. //
  176. // NOTES: No reason to have this one here, but I don't want to break the build.
  177. //
  178. #ifndef WINCOMMCTRLAPI
  179. int WINAPI StrToInt(LPCTSTR lpSrc); // atoi()
  180. #endif
  181. #define POSINVALID 32767 // values for invalid position
  182. #define IDCMD_SYSTEMFIRST 0x8000
  183. #define IDCMD_SYSTEMLAST 0xbfff
  184. #define IDCMD_CANCELED 0xbfff
  185. #define IDCMD_PROCESSED 0xbffe
  186. #define IDCMD_DEFAULT 0xbffe
  187. /* timedate.c */
  188. // **********************************************************************
  189. // DATE is a structure with a date packed into a WORD size value. It
  190. // is compatible with a file date in a directory entry structure.
  191. // **********************************************************************
  192. #ifndef DATE_DEFINED
  193. typedef struct
  194. {
  195. WORD Day :5; // Day number 1 - 31
  196. WORD Month :4; // Month number 1 - 12
  197. WORD Year :7; // Year subtracted from 1980, 0-127
  198. } WORD_DATE;
  199. typedef union
  200. {
  201. WORD wDate;
  202. WORD_DATE sDate;
  203. } WDATE;
  204. #define DATE_DEFINED
  205. #endif
  206. // **********************************************************************
  207. // TIME is a structure with a 24 hour time packed into a WORD size value.
  208. // It is compatible with a file time in a directory entry structure.
  209. // **********************************************************************
  210. #ifndef TIME_DEFINED
  211. typedef struct
  212. {
  213. WORD Sec :5; // Seconds divided by 2 (0 - 29).
  214. WORD Min :6; // Minutes 0 - 59
  215. WORD Hour :5; // Hours 0 - 24
  216. } WORD_TIME;
  217. typedef union
  218. {
  219. WORD wTime;
  220. WORD_TIME sTime;
  221. } WTIME;
  222. #define TIME_DEFINED
  223. #endif
  224. WINSHELLAPI WORD WINAPI Shell_GetCurrentDate(void);
  225. WINSHELLAPI WORD WINAPI Shell_GetCurrentTime(void);
  226. //====== SEMI-PRIVATE API ===============================
  227. #ifndef HPSXA_DEFINED
  228. #define HPSXA_DEFINED
  229. DECLARE_HANDLE( HPSXA );
  230. #endif // HPSXA_DEFINED
  231. //====== SEMI-PRIVATE API ORDINALS ===============================
  232. // This is the list of semi-private ordinals we semi-publish.
  233. #define SHObjectPropertiesORD 178
  234. #define SHCreateDefClassObjectORD 70
  235. #define SHGetNetResourceORD 69
  236. #define SHEXP_SHCREATEDEFCLASSOBJECT MAKEINTRESOURCE(SHCreateDefClassObjectORD)
  237. #define SHEXP_SHGETNETRESOURCE MAKEINTRESOURCE(SHGetNetResourceORD)
  238. #ifdef __cplusplus
  239. }
  240. #endif /* __cplusplus */
  241. #ifndef RC_INVOKED
  242. #ifndef NOPRAGMAS
  243. #pragma pack()
  244. #endif /* NOPRAGMAS */
  245. #endif /* !RC_INVOKED */
  246. #endif // _SHSEMIP_H_