Source code of Windows XP (NT5)
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.

109 lines
4.9 KiB

  1. #ifndef _URLSHELL_H_
  2. #define _URLSHELL_H_
  3. // This header is an extraction of private macros and prototypes that
  4. // originally came from shellp.h and shellprv.h.
  5. #define DATASEG_READONLY DATA_SEG_READ_ONLY
  6. #ifndef DebugMsg /* ;Internal */
  7. #define DM_TRACE 0x0001 // Trace messages /* ;Internal */
  8. #define DM_WARNING 0x0002 // Warning /* ;Internal */
  9. #define DM_ERROR 0x0004 // Error /* ;Internal */
  10. #define DM_ASSERT 0x0008 // Assertions /* ;Internal */
  11. #define Assert(f) /* ;Internal */
  12. #define AssertE(f) (f) /* ;Internal */
  13. #define AssertMsg 1 ? (void)0 : (void) /* ;Internal */
  14. #define DebugMsg 1 ? (void)0 : (void) /* ;Internal */
  15. #endif /* ;Internal */
  16. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  17. #define ENTERCRITICAL Shell_EnterCriticalSection();
  18. #define LEAVECRITICAL Shell_LeaveCriticalSection();
  19. void Shell_EnterCriticalSection(void);
  20. void Shell_LeaveCriticalSection(void);
  21. #define CCH_KEYMAX 64 // DOC: max size of a reg key (under shellex)
  22. #define FillExecInfo(_info, _hwnd, _verb, _file, _params, _dir, _show) \
  23. (_info).hwnd = _hwnd; \
  24. (_info).lpVerb = _verb; \
  25. (_info).lpFile = _file; \
  26. (_info).lpParameters = _params; \
  27. (_info).lpDirectory = _dir; \
  28. (_info).nShow = _show; \
  29. (_info).fMask = 0; \
  30. (_info).cbSize = SIZEOF(SHELLEXECUTEINFO);
  31. // Define some registry caching apis. This will allow us to minimize the
  32. // changes needed in the shell code and still try to reduce the number of
  33. // calls that we make to the registry.
  34. LONG SHRegQueryValueA(HKEY hKey,LPCSTR lpSubKey,LPSTR lpValue,PLONG lpcbValue);
  35. LONG SHRegQueryValueExA(HKEY hKey,LPCSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
  36. LONG SHRegQueryValueW(HKEY hKey,LPCWSTR lpSubKey,LPWSTR lpValue,PLONG lpcbValue);
  37. LONG SHRegQueryValueExW(HKEY hKey,LPCWSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
  38. #define GCD_MUSTHAVEOPENCMD 0x0001
  39. #define GCD_ADDEXETODISPNAME 0x0002 // must be used with GCD_MUSTHAVEOPENCMD
  40. #define GCD_ALLOWPSUDEOCLASSES 0x0004 // .ext type extensions
  41. // Only valid when used with FillListWithClasses
  42. #define GCD_MUSTHAVEEXTASSOC 0x0008 // There must be at least one extension assoc
  43. #define DECLAREWAITCURSOR HCURSOR hcursor_wait_cursor_save
  44. #define SetWaitCursor() hcursor_wait_cursor_save = SetCursor(LoadCursor(NULL, IDC_WAIT))
  45. #define ResetWaitCursor() SetCursor(hcursor_wait_cursor_save)
  46. // indexes into the shell image lists (Shell_GetImageList) for default images
  47. // If you add to this list, you also need to update II_LASTSYSICON!
  48. #define II_DOCNOASSOC 0 // document (blank page) (not associated)
  49. #define II_APPLICATION 2 // application (exe, com, bat)
  50. WINSHELLAPI BOOL WINAPI Shell_GetImageLists(HIMAGELIST *phiml, HIMAGELIST *phimlSmall);
  51. extern DWORD WINAPI GetExeType(LPCTSTR pszFile);
  52. WINSHELLAPI void WINAPI ILFree(LPITEMIDLIST pidl);
  53. //======Hash Item=============================================================
  54. typedef struct _HashTable * PHASHTABLE;
  55. #define PHASHITEM LPCTSTR
  56. typedef void (CALLBACK *HASHITEMCALLBACK)(PHASHTABLE pht, LPCTSTR sz, UINT wUsage, DWORD param);
  57. LPCTSTR WINAPI FindHashItem (PHASHTABLE pht, LPCTSTR lpszStr);
  58. LPCTSTR WINAPI AddHashItem (PHASHTABLE pht, LPCTSTR lpszStr);
  59. LPCTSTR WINAPI DeleteHashItem(PHASHTABLE pht, LPCTSTR lpszStr);
  60. LPCTSTR WINAPI PurgeHashItem (PHASHTABLE pht, LPCTSTR lpszStr);
  61. #define GetHashItemName(pht, sz, lpsz, cch) lstrcpyn(lpsz, sz, cch)
  62. PHASHTABLE WINAPI CreateHashItemTable(UINT wBuckets, UINT wExtra, BOOL fCaseSensitive);
  63. void WINAPI DestroyHashItemTable(PHASHTABLE pht);
  64. void WINAPI SetHashItemData(PHASHTABLE pht, LPCTSTR lpszStr, int n, DWORD dwData);
  65. DWORD WINAPI GetHashItemData(PHASHTABLE pht, LPCTSTR lpszStr, int n);
  66. void * WINAPI GetHashItemDataPtr(PHASHTABLE pht, LPCTSTR lpszStr);
  67. void WINAPI EnumHashItems(PHASHTABLE pht, HASHITEMCALLBACK callback, DWORD dwParam);
  68. #ifdef DEBUG
  69. void WINAPI DumpHashItemTable(PHASHTABLE pht);
  70. #endif
  71. #ifndef SIZEOF
  72. #define SIZEOF(a) sizeof(a)
  73. #endif
  74. #ifndef ARRAYSIZE
  75. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  76. #endif
  77. #define PATH_CCH_EXT 64
  78. #endif // _URLSHELL_H_