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.

163 lines
3.1 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. #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. #include <strsafe.h>
  41. #ifndef _RESOURCE_H_
  42. #include "resource.h"
  43. #endif
  44. /*-[ types and defines ]-----------------------------------*/
  45. // unicode version is for NT only.
  46. #ifdef UNICODE
  47. #define NT
  48. #endif
  49. #ifdef ANSI
  50. #define WIN95
  51. #endif
  52. // just my preference
  53. #define true TRUE
  54. #define false FALSE
  55. // to help root out hard coded strings that don't belong
  56. #define FMT TEXT
  57. #define NullString(a) *(a) = TCHAR('\0')
  58. // standard buffer sizes
  59. #define S_SIZE 1024
  60. #define SBUF_SIZE (S_SIZE * sizeof(TCHAR))
  61. #define OCO_COLLECT_NODEPENDENT 0x80000000
  62. // per component data
  63. typedef struct _PER_COMPONENT_DATA {
  64. struct _PER_COMPONENT_DATA *Next;
  65. LPCTSTR ComponentId;
  66. HINF hinf;
  67. DWORDLONG Flags;
  68. LANGID LanguageId;
  69. TCHAR *SourcePath;
  70. OCMANAGER_ROUTINES HelperRoutines;
  71. EXTRA_ROUTINES ExtraRoutines;
  72. HSPFILEQ queue;
  73. LONG UnattendedOverride;
  74. } PER_COMPONENT_DATA, *PPER_COMPONENT_DATA;
  75. /*-[ functions ]-------------------------------------------*/
  76. // just for utility
  77. #ifdef UNICODE
  78. #define tsscanf swscanf
  79. #define tvsprintf vswprintf
  80. #else
  81. #define tsscanf sscanf
  82. #define tvsprintf vsprintf
  83. #endif
  84. // from util.cpp
  85. DWORD MsgBox(HWND hwnd, UINT textID, UINT type, ... );
  86. DWORD MsgBox(HWND hwnd, LPCTSTR fmt, LPCTSTR caption, UINT type, ... );
  87. DWORD MBox(LPCTSTR fmt, LPCTSTR caption, ... );
  88. DWORD TMBox(LPCTSTR fmt, ... );
  89. #define mbox MBox
  90. #define tmbox TMBox
  91. void logOCNotification(DWORD msg, const TCHAR *component);
  92. void logOCNotificationCompletion();
  93. void loginit();
  94. void log(TCHAR *fmt, ...);
  95. BOOL IsNT();
  96. #if defined(__cplusplus)
  97. extern "C" {
  98. #endif
  99. // from ocgen.cpp
  100. BOOL ToBeInstalled(TCHAR *component);
  101. BOOL WasInstalled(TCHAR *component);
  102. DWORD SetupCurrentUser();
  103. DWORD GetMyVersion(DWORD *major, DWORD *minor);
  104. VOID ReplaceExplorerStartMenuBitmap(VOID);
  105. DWORD OcLog(LPCTSTR ComponentId, UINT level, LPCTSTR sz);
  106. DWORD SysGetDebugLevel();
  107. // from util.cpp
  108. void DebugTraceNL(DWORD level, const TCHAR *text);
  109. void DebugTrace(DWORD level, const TCHAR *text);
  110. void DebugTraceOCNotification(DWORD msg, const TCHAR *component);
  111. void DebugTraceFileCopy(const TCHAR *file);
  112. void DebugTraceFileCopyError();
  113. void DebugTraceDirCopy(const TCHAR *dir);
  114. #if defined(__cplusplus)
  115. }
  116. #endif
  117. /*-[ global data ]-----------------------------------------*/
  118. #ifndef _OCGEN_CPP_
  119. #define EXTERN extern
  120. #else
  121. #define EXTERN
  122. #endif
  123. // general stuff
  124. EXTERN HINSTANCE ghinst; // app instance handle
  125. EXTERN HWND ghwnd; // wizard window handle