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.

169 lines
3.4 KiB

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