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.

282 lines
9.9 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1996 - 1999
  3. Module Name:
  4. calmsgs
  5. Abstract:
  6. This header file describes the symbols and macros used in the Calais Event
  7. Logging components.
  8. Author:
  9. Doug Barlow (dbarlow) 5/15/1997
  10. Environment:
  11. C++, Win32
  12. Notes:
  13. --*/
  14. #ifndef _CALMSGS_H_
  15. #define _CALMSGS_H_
  16. #include <tchar.h>
  17. #ifdef DBG
  18. #include <eh.h>
  19. #endif
  20. #define CALSTR_CALAISEXECUTABLE 1 // "%windir%\\system32\\SCardSvr.exe"
  21. #define CALSTR_PRIMARYSERVICE 2 // "SCardSvr"
  22. #define CALSTR_CALAISREGISTRYKEY 4 // "SOFTWARE\\Microsoft\\Cryptography\\Calais"
  23. #define CALSTR_READERREGISTRYKEY 5 // "SOFTWARE\\Microsoft\\Cryptography\\Calais\\Readers"
  24. #define CALSTR_SMARTCARDREGISTRYKEY 6 // "SOFTWARE\\Microsoft\\Cryptography\\Calais\\SmartCards"
  25. #define CALSTR_READERREGISTRYSUBKEY 7 // "Readers"
  26. #define CALSTR_DEVICEREGISTRYSUBKEY 8 // "Device"
  27. #define CALSTR_GROUPSREGISTRYSUBKEY 9 // "Groups"
  28. #define CALSTR_ATRREGISTRYSUBKEY 10 // "ATR"
  29. #define CALSTR_ATRMASKREGISTRYSUBKEY 11 // "ATRMask"
  30. #define CALSTR_INTERFACESREGISTRYSUBKEY 12 // "Supported Interfaces"
  31. #define CALSTR_PRIMARYPROVIDERSUBKEY 13 // "Primary Provider"
  32. #define CALSTR_CRYPTOPROVIDERSUBKEY 14 // "Crypto Provider"
  33. #define CALSTR_SERVICESREGISTRYKEY 15 // "SYSTEM\\CurrentControlSet\\Services"
  34. #define CALSTR_EVENTLOGREGISTRYKEY 16 // "SYSTEM\\CurrentControlSet\\Services\\EventLog"
  35. #define CALSTR_SYSTEMREGISTRYSUBKEY 17 // "System"
  36. #define CALSTR_EVENTMESSAGEFILESUBKEY 18 // "EventMessageFile"
  37. #define CALSTR_TYPESSUPPORTEDSUBKEY 19 // "TypesSupported"
  38. #define CALSTR_PNPDEVICEREGISTRYKEY 20 // "SYSTEM\\CurrentControlSet\\Control\\DeviceClasses\\{50dd5230-ba8a-11d1-bf5d-0000f805f530}"
  39. #define CALSTR_SYMBOLICLINKSUBKEY 21 // "SymbolicLink"
  40. #define CALSTR_VXDPATHREGISTRYKEY 22 // "System\\CurrentControlSet\\Services\\VxD\\Smclib\\Devices"
  41. #define CALSTR_LEGACYDEPENDONGROUP 23 // "+Smart Card Reader"
  42. #define CALSTR_NEWREADEREVENTNAME 24 // "Global\\Microsoft Smart Card Resource Manager New Reader"
  43. #define CALSTR_STARTEDEVENTNAME 25 // "Global\\Microsoft Smart Card Resource Manager Started"
  44. #define CALSTR_CANCELEVENTPREFIX 26 // "Global\\Microsoft Smart Card Cancel Event for %1!d!"
  45. #define CALSTR_COMMPIPENAME 27 // "Microsoft Smart Card Resource Manager"
  46. #define CALSTR_LEGACYDEVICEHEADER 28 // "\\\\.\\"
  47. #define CALSTR_LEGACYDEVICENAME 29 // "SCReader"
  48. #define CALSTR_MAXLEGACYDEVICES 30 // "MaxLegacyDevices"
  49. #define CALSTR_MAXDEFAULTBUFFER 31 // "MaxDefaultBuffer"
  50. #define CALSTR_PIPEDEVICEHEADER 32 // "\\\\.\\pipe\\"
  51. #define CALSTR_SERVICEDEPENDENCIES 33 // "PlugPlay\000"
  52. #define CALSTR_SPECIALREADERHEADER 34 // "\\\\?PNP?\\"
  53. #define CALSTR_ACTIVEREADERCOUNTREADER 35 // "NOTIFICATION"
  54. #define CALSTR_CERTPROPREGISTRY 36 // "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Notify"
  55. #define CALSTR_CERTPROPKEY 37 // "ScCertProp"
  56. #define CALSTR_DLLNAME 38 // "DLLName"
  57. #define CALSTR_LOGON 39 // "Logon"
  58. #define CALSTR_LOGOFF 40 // "Logoff"
  59. #define CALSTR_LOCK 41 // "Lock"
  60. #define CALSTR_UNLOCK 42 // "Unlock"
  61. #define CALSTR_ENABLED 43 // "Enabled"
  62. #define CALSTR_IMPERSONATE 44 // "Impersonate"
  63. #define CALSTR_ASYNCHRONOUS 45 // "Asynchronous"
  64. #define CALSTR_CERTPROPDLL 46 // "WlNotify.dll"
  65. #define CALSTR_CERTPROPSTART 47 // "SCardStartCertProp"
  66. #define CALSTR_CERTPROPSTOP 48 // "SCardStopCertProp"
  67. #define CALSTR_CERTPROPSUSPEND 49 // "SCardSuspendCertProp"
  68. #define CALSTR_CERTPROPRESUME 50 // "SCardResumeCertProp"
  69. #define CALSTR_SMARTCARDINSERTION 51 // "SmartcardInsertion"
  70. #define CALSTR_SMARTCARDREMOVAL 52 // "SmartcardRemoval"
  71. #define CALSTR_APPEVENTS 53 // "AppEvents"
  72. #define CALSTR_EVENTLABELS 54 // "EventLabels"
  73. #define CALSTR_DOT_DEFAULT 55 // ".Default"
  74. #define CALSTR_DOT_CURRENT 56 // ".Current"
  75. #define CALSTR_SOUNDSREGISTRY 57 // "Schemes\\Apps\\.Default"
  76. #define CALSTR_LOGONREGISTRY 58 // "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"
  77. #define CALSTR_LOGONREMOVEOPTION 59 // "ScRemoveOption"
  78. #define CALSTR_STOPPEDEVENTNAME 60 // "Global\\Microsoft Smart Card Resource Manager Stopped"
  79. // Unused
  80. // CALSTR_TEMPLATEREGISTRYKEY ?n? // "SOFTWARE\\Microsoft\\Cryptography\\Calais\\SmartCard Templates"
  81. // CALSTR_OEMCONFIGREGISTRYSUBKEY ?n? // "OEM Configuration"
  82. // Debug only
  83. #define CALSTR_DEBUGSERVICE 61 // "SCardDbg"
  84. #define CALSTR_DEBUGREGISTRYSUBKEY 62 // "Debug"
  85. #ifdef DBG
  86. #define CALSTR_DEBUGLOGSUBKEY 63 // "Debug"
  87. #define CALSTR_GUIWARNINGSUBKEY 64 // "GuiWarnings"
  88. #define CALSTR_LOGSEVERITYSUBKEY 65 // "LogSeverity"
  89. #define CALSTR_GUISEVERITYSUBKEY 66 // "GuiSeverity"
  90. #define CALSTR_APITRACEFILENAME 67 // "C:\\SCard.log"
  91. #define CALSTR_DRIVERTRACEFILENAME 68 // "C:\\Calais.log"
  92. #define CALSTR_MESSAGETAG 69 // " *MESSAGE* "
  93. #define CALSTR_INFOMESSAGETAG 70 // " *INFO* "
  94. #define CALSTR_WARNINGMESSAGETAG 71 // " *WARNING* "
  95. #define CALSTR_ERRORMESSAGETAG 72 // " *ERROR* "
  96. #define CALSTR_DEBUGSERVICEDISPLAY 73 // "Smart Card Debug"
  97. #define CALSTR_DEBUGSERVICEDESC 74 // "Start this service first to debug Smart card service startup"
  98. #endif
  99. // Internationalizable
  100. #define CALSTR_RESOURCELIMIT 100 // String Ids larger than this are resources
  101. #define CALSTR_PRIMARYSERVICEDISPLAY CALSTR_RESOURCELIMIT + IDS_PRIMARYSERVICEDISPLAY // "Smart Card"
  102. #define CALSTR_LEGACYSERVICEDISPLAY CALSTR_RESOURCELIMIT + IDS_LEGACYSERVICEDISPLAY // "Smart Card Helper"
  103. #define CALSTR_SMARTCARD_INSERTION CALSTR_RESOURCELIMIT + IDS_SMARTCARD_INSERTION // "Smart Card Insertion"
  104. #define CALSTR_SMARTCARD_REMOVAL CALSTR_RESOURCELIMIT + IDS_SMARTCARD_REMOVAL // "Smart Card Removal"
  105. #define CALSTR_PRIMARYSERVICEDESC CALSTR_RESOURCELIMIT + IDS_PRIMARYSERVICEDESC
  106. #define CALSTR_LEGACYSERVICEDESC CALSTR_RESOURCELIMIT + IDS_LEGACYSERVICEDESC
  107. extern const LPCTSTR g_rgszDefaultStrings[];
  108. extern void
  109. CalaisMessageInit(
  110. LPCTSTR szTitle,
  111. HANDLE hEventLogger = NULL,
  112. BOOL fServer = FALSE);
  113. extern void
  114. CalaisMessageClose(
  115. void);
  116. extern LPCTSTR
  117. CalaisString(
  118. DWORD dwStringId);
  119. #ifdef DBG
  120. #define DBGT(x) _T(x)
  121. #define DEBUG_TEXT LPCTSTR
  122. #define CalaisDebug(a) _CalaisDebug a
  123. extern void
  124. CalaisInfo(
  125. DEBUG_TEXT szSubroutine,
  126. DEBUG_TEXT szMessage,
  127. LPCTSTR szParam1 = NULL,
  128. LPCTSTR szParam2 = NULL,
  129. LPCTSTR szParam3 = NULL);
  130. extern void
  131. CalaisInfo(
  132. DEBUG_TEXT szSubroutine,
  133. DEBUG_TEXT szMessage,
  134. DWORD dwErrorCode,
  135. LPCTSTR szParam2 = NULL,
  136. LPCTSTR szParam3 = NULL);
  137. extern void
  138. CalaisWarning(
  139. DEBUG_TEXT szSubroutine,
  140. DEBUG_TEXT szMessage,
  141. LPCTSTR szParam1 = NULL,
  142. LPCTSTR szParam2 = NULL,
  143. LPCTSTR szParam3 = NULL);
  144. extern void
  145. CalaisWarning(
  146. DEBUG_TEXT szSubroutine,
  147. DEBUG_TEXT szMessage,
  148. DWORD dwErrorCode,
  149. LPCTSTR szParam2 = NULL,
  150. LPCTSTR szParam3 = NULL);
  151. extern void
  152. CalaisError(
  153. DEBUG_TEXT szSubroutine,
  154. DEBUG_TEXT szMessage,
  155. LPCTSTR szParam1 = NULL,
  156. LPCTSTR szParam2 = NULL,
  157. DWORD dwLineNo = 0);
  158. extern void
  159. _CalaisDebug(
  160. DEBUG_TEXT szMessage,
  161. ...);
  162. extern void
  163. CalaisSetDebug(
  164. BOOLEAN Debug
  165. );
  166. extern void
  167. CalaisMessageLog(
  168. DEBUG_TEXT szSubroutine,
  169. WORD wSeverity,
  170. DEBUG_TEXT szMessageStr,
  171. DEBUG_TEXT *rgszParams = NULL,
  172. LPCVOID pvBinaryData = NULL,
  173. DWORD cbBinaryData = 0);
  174. extern void
  175. WriteApiLog(
  176. LPCVOID pvData,
  177. DWORD cbLength);
  178. #else
  179. #define DBGT(x) ((LPCBYTE)(0))
  180. #define DEBUG_TEXT LPCBYTE
  181. #define CalaisDebug(a)
  182. inline void
  183. CalaisInfo(
  184. DEBUG_TEXT szSubroutine,
  185. DEBUG_TEXT szMessage,
  186. LPCTSTR szParam1 = NULL,
  187. LPCTSTR szParam2 = NULL,
  188. LPCTSTR szParam3 = NULL)
  189. {}
  190. inline void
  191. CalaisInfo(
  192. DEBUG_TEXT szSubroutine,
  193. DEBUG_TEXT szMessage,
  194. DWORD dwErrorCode,
  195. LPCTSTR szParam2 = NULL,
  196. LPCTSTR szParam3 = NULL)
  197. {}
  198. inline void
  199. CalaisWarning(
  200. DEBUG_TEXT szSubroutine,
  201. DEBUG_TEXT szMessage,
  202. LPCTSTR szParam1 = NULL,
  203. LPCTSTR szParam2 = NULL,
  204. LPCTSTR szParam3 = NULL)
  205. {}
  206. inline void
  207. CalaisWarning(
  208. DEBUG_TEXT szSubroutine,
  209. DEBUG_TEXT szMessage,
  210. DWORD dwErrorCode,
  211. LPCTSTR szParam2 = NULL,
  212. LPCTSTR szParam3 = NULL)
  213. {}
  214. #endif
  215. extern void
  216. CalaisError(
  217. DEBUG_TEXT szSubroutine,
  218. DWORD dwMessageId,
  219. DWORD dwErrorCode,
  220. LPCTSTR szParam2 = NULL,
  221. LPCTSTR szParam3 = NULL);
  222. extern void
  223. CalaisError(
  224. DEBUG_TEXT szSubroutine,
  225. DWORD dwMessageId,
  226. LPCTSTR szParam1 = NULL,
  227. LPCTSTR szParam2 = NULL,
  228. LPCTSTR szParam3 = NULL);
  229. extern void
  230. CalaisMessageLog(
  231. DEBUG_TEXT szSubroutine,
  232. WORD wSeverity,
  233. DWORD dwMessageId,
  234. LPCTSTR *rgszParams = NULL,
  235. LPCVOID pvBinaryData = NULL,
  236. DWORD cbBinaryData = 0);
  237. #ifndef ASSERT
  238. #if defined(_DEBUG)
  239. #define ASSERT(x) _ASSERTE(x)
  240. #if !defined(DBG)
  241. #define DBG
  242. #endif
  243. #elif defined(DBG)
  244. #define ASSERT(x) if (!(x)) { \
  245. CalaisError(DBGT("Assert"), DBGT("Failed Assertion: %1 at %2(%3)"), #x, __FILE__, __LINE__); \
  246. DebugBreak(); }
  247. #else
  248. #define ASSERT(x)
  249. #endif
  250. #endif
  251. #endif // _CALMSGS_H_