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.

154 lines
3.8 KiB

  1. /*
  2. * project.h - Common project header file for URL Shell extension DLL.
  3. */
  4. /* System Headers
  5. *****************/
  6. #define INC_OLE2 /* for windows.h */
  7. #define CONST_VTABLE /* for objbase.h */
  8. #pragma warning(disable:4514) /* "unreferenced __inlinefunction" warning */
  9. #pragma warning(disable:4001) /* "single line comment" warning */
  10. #pragma warning(disable:4115) /* "named type definition in parentheses" warning */
  11. #pragma warning(disable:4201) /* "nameless struct/union" warning */
  12. #pragma warning(disable:4209) /* "benign typedef redefinition" warning */
  13. #pragma warning(disable:4214) /* "bit field types other than int" warning */
  14. #pragma warning(disable:4218) /* "must specify at least a storage class or type" warning */
  15. #ifndef WIN32_LEAN_AND_MEAN /* NT builds define this for us */
  16. #define WIN32_LEAN_AND_MEAN /* for windows.h */
  17. #endif /* WIN32_LEAN_AND_MEAN */
  18. #include <windows.h>
  19. #pragma warning(disable:4001) /* "single line comment" warning - windows.h enabled it */
  20. #include <shlwapi.h>
  21. #include <shlwapip.h>
  22. #include <shellapi.h>
  23. #include <shlobj.h>
  24. #include <shlobjp.h>
  25. #include <shellp.h>
  26. #include <comctrlp.h>
  27. #include <shlobjp.h>
  28. #include <shlapip.h>
  29. #pragma warning(default:4218) /* "must specify at least a storage class or type" warning */
  30. #pragma warning(default:4214) /* "bit field types other than int" warning */
  31. #pragma warning(default:4209) /* "benign typedef redefinition" warning */
  32. #pragma warning(default:4201) /* "nameless struct/union" warning */
  33. #pragma warning(default:4115) /* "named type definition in parentheses" warning */
  34. #include <limits.h>
  35. #ifdef __cplusplus
  36. extern "C" { /* Assume C declarations for C++. */
  37. #endif /* __cplusplus */
  38. #include <crtfree.h> // Use intrinsic functions to avoid CRT
  39. // StrChr is provided by SHLWAPI
  40. #define strchr StrChr
  41. // Avoid name conflicts with Nashville commctrl
  42. #define StrToIntExW UrlStrToIntExW
  43. #define StrToIntExA UrlStrToIntExA
  44. #define StrSpnW UrlStrSpnW
  45. #define StrSpnA UrlStrSpnA
  46. #define StrPBrkW UrlStrPBrkW
  47. #define StrPBrkA UrlStrPBrkA
  48. #define strpbrk StrPBrk
  49. // Avoid name conflicts with shlwapi
  50. #undef GetMIMETypeSubKey
  51. #undef RegisterMIMETypeForExtension
  52. #undef UnregisterMIMETypeForExtension
  53. #undef RegisterExtensionForMIMEType
  54. #undef UnregisterExtensionForMIMEType
  55. #undef MIME_GetExtension
  56. __inline BOOL AllocateMemory(DWORD dwcbSize, PVOID *ppvNew)
  57. {
  58. *ppvNew = GlobalAlloc(GPTR, dwcbSize);
  59. return(*ppvNew != NULL);
  60. }
  61. __inline BOOL ReallocateMemory(PVOID pvOld, DWORD dwcbNewSize, PVOID *ppvNew)
  62. {
  63. *ppvNew = GlobalReAlloc(pvOld, dwcbNewSize, GMEM_MOVEABLE);
  64. return(*ppvNew != NULL);
  65. }
  66. __inline void FreeMemory(PVOID pv)
  67. {
  68. GlobalFree(pv);
  69. return;
  70. }
  71. __inline DWORD MemorySize(PVOID pv)
  72. {
  73. return(DWORD)(GlobalSize(pv));
  74. }
  75. /* Project Headers
  76. ******************/
  77. /* The order of the following include files is significant. */
  78. #ifdef NO_HELP
  79. #undef NO_HELP
  80. #endif
  81. #include "stock.h"
  82. #include "serial.h"
  83. #ifdef DEBUG
  84. #include "inifile.h"
  85. #include "resstr.h"
  86. #endif
  87. #include "debbase.h"
  88. #include "debspew.h"
  89. #include "valid.h"
  90. #include "util.h"
  91. #include "comc.h"
  92. #if defined(_X86_)
  93. extern BOOL g_bRunningOnNT;
  94. #define RUNNING_NT g_bRunningOnNT
  95. #else
  96. #define RUNNING_NT 1
  97. #endif
  98. /* Constants
  99. ************/
  100. /*
  101. * constants to be used with #pragma data_seg()
  102. *
  103. * These section names must be given the associated attributes in the project's
  104. * module definition file.
  105. */
  106. #define DATA_SEG_READ_ONLY ".text"
  107. #define DATA_SEG_PER_INSTANCE ".data"
  108. #define DATA_SEG_SHARED ".shared"
  109. #ifdef DEBUG
  110. #define INDENT_STRING " "
  111. #endif
  112. #ifdef __cplusplus
  113. } /* End of extern "C" {. */
  114. #endif /* __cplusplus */