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.

164 lines
3.3 KiB

  1. /*
  2. * Copyright (c) 2001 Microsoft Corporation
  3. *
  4. * Module Name:
  5. *
  6. * POP3oc.h
  7. *
  8. * Abstract:
  9. *
  10. * This file defines oc manager generic component
  11. *
  12. * Author:
  13. *
  14. * Paolo Raden (paolora) Nov-20-2001
  15. *
  16. * Environment:
  17. *
  18. * User Mode
  19. */
  20. #ifdef _POP3OC_H_
  21. #error "pop3oc.h already included!"
  22. #else
  23. #define _OCGEN_H_
  24. #endif
  25. #ifndef _WINDOWS_H_
  26. #include <windows.h>
  27. #endif
  28. #ifndef _TCHAR_H_
  29. #include <tchar.h>
  30. #endif
  31. #ifndef _SETUPAPI_H_
  32. #include <setupapi.h>
  33. #endif
  34. #ifndef _OCMANAGE_H_
  35. #include "ocmanage.h"
  36. #endif
  37. #ifndef _PRSHT_H_
  38. #include <prsht.h>
  39. #endif
  40. #ifndef _RESOURCE_H_
  41. #include "resource.h"
  42. #endif
  43. /*-[ types and defines ]-----------------------------------*/
  44. // unicode version is for NT only.
  45. #ifdef UNICODE
  46. #define NT
  47. #endif
  48. #ifdef ANSI
  49. #define WIN95
  50. #endif
  51. // just my preference
  52. #define true TRUE
  53. #define false FALSE
  54. // to help root out hard coded strings that don't belong
  55. #define FMT TEXT
  56. #define NullString(a) *(a) = TCHAR('\0')
  57. // standard buffer sizes
  58. #define S_SIZE 1024
  59. #define SBUF_SIZE (S_SIZE * sizeof(TCHAR))
  60. // per component data
  61. typedef struct _PER_COMPONENT_DATA {
  62. struct _PER_COMPONENT_DATA *Next;
  63. LPCTSTR ComponentId;
  64. HINF hinf;
  65. DWORDLONG Flags;
  66. LANGID LanguageId;
  67. TCHAR *SourcePath;
  68. OCMANAGER_ROUTINES HelperRoutines;
  69. EXTRA_ROUTINES ExtraRoutines;
  70. HSPFILEQ queue;
  71. LONG UnattendedOverride;
  72. } PER_COMPONENT_DATA, *PPER_COMPONENT_DATA;
  73. /*-[ functions ]-------------------------------------------*/
  74. // just for utility
  75. #ifdef UNICODE
  76. #define tsscanf swscanf
  77. #define tvsprintf vswprintf
  78. #else
  79. #define tsscanf sscanf
  80. #define tvsprintf vsprintf
  81. #endif
  82. // from util.cpp
  83. DWORD MsgBox(HWND hwnd, UINT textID, UINT type, ... );
  84. DWORD MsgBox(HWND hwnd, LPCTSTR fmt, LPCTSTR caption, UINT type, ... );
  85. DWORD MBox(LPCTSTR fmt, LPCTSTR caption, ... );
  86. DWORD TMBox(LPCTSTR fmt, ... );
  87. #define mbox MBox
  88. #define tmbox TMBox
  89. void logOCNotification(DWORD msg, const TCHAR *component);
  90. void logOCNotificationCompletion();
  91. void loginit();
  92. void log(TCHAR *fmt, ...);
  93. void AssureTrailingBackslash(TCHAR *path);
  94. BOOL IsNT();
  95. #if defined(__cplusplus)
  96. extern "C" {
  97. #endif
  98. // from pop3oc.cpp
  99. BOOL ToBeInstalled(TCHAR *component);
  100. BOOL WasInstalled(TCHAR *component);
  101. DWORD SetupCurrentUser();
  102. DWORD GetMyVersion(DWORD *major, DWORD *minor);
  103. VOID ReplaceExplorerStartMenuBitmap(VOID);
  104. DWORD OcLog(LPCTSTR ComponentId, UINT level, LPCTSTR sz);
  105. DWORD SysGetDebugLevel();
  106. // from util.cpp
  107. void DebugTraceNL(DWORD level, const TCHAR *text);
  108. void DebugTrace(DWORD level, const TCHAR *text);
  109. void DebugTraceOCNotification(DWORD msg, const TCHAR *component);
  110. void DebugTraceFileCopy(const TCHAR *file);
  111. void DebugTraceFileCopyError();
  112. void DebugTraceDirCopy(const TCHAR *dir);
  113. #if defined(__cplusplus)
  114. }
  115. #endif
  116. /*-[ global data ]-----------------------------------------*/
  117. #ifndef _POP3OC_CPP_
  118. #define EXTERN extern
  119. #else
  120. #define EXTERN
  121. #endif
  122. // general stuff
  123. EXTERN HINSTANCE ghinst; // app instance handle
  124. EXTERN HWND ghwnd; // wizard window handle
  125. // per-component info storage
  126. EXTERN PPER_COMPONENT_DATA gcd; // array of all components we are installing