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.

463 lines
13 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: mscat32.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifdef _M_IX86
  11. #include <windows.h>
  12. #include <wincrypt.h>
  13. #include <mscat.h>
  14. STDAPI mscat32DllRegisterServer(void);
  15. EXTERN_C
  16. __declspec(naked)
  17. HRESULT
  18. STDAPICALLTYPE
  19. DllRegisterServer()
  20. {
  21. __asm {
  22. jmp mscat32DllRegisterServer
  23. }
  24. }
  25. STDAPI mscat32DllUnregisterServer(void);
  26. EXTERN_C
  27. __declspec(naked)
  28. HRESULT
  29. STDAPICALLTYPE
  30. DllUnregisterServer()
  31. {
  32. __asm {
  33. jmp mscat32DllUnregisterServer
  34. }
  35. }
  36. EXTERN_C
  37. __declspec(naked)
  38. HANDLE WINAPI ForwardrCryptCATOpen(IN LPWSTR pwszFileName,
  39. IN DWORD fdwOpenFlags,
  40. IN OPTIONAL HCRYPTPROV hProv,
  41. IN OPTIONAL DWORD dwPublicVersion,
  42. IN OPTIONAL DWORD dwEncodingType)
  43. {
  44. __asm {
  45. jmp CryptCATOpen
  46. }
  47. }
  48. EXTERN_C
  49. __declspec(naked)
  50. BOOL WINAPI ForwardrCryptCATClose(IN HANDLE hCatalog)
  51. {
  52. __asm {
  53. jmp CryptCATClose
  54. }
  55. }
  56. EXTERN_C
  57. __declspec(naked)
  58. CRYPTCATSTORE * WINAPI ForwardrCryptCATStoreFromHandle(IN HANDLE hCatalog)
  59. {
  60. __asm {
  61. jmp CryptCATStoreFromHandle
  62. }
  63. }
  64. EXTERN_C
  65. __declspec(naked)
  66. HANDLE WINAPI ForwardrCryptCATHandleFromStore(IN CRYPTCATSTORE *pCatStore)
  67. {
  68. __asm {
  69. jmp CryptCATHandleFromStore
  70. }
  71. }
  72. EXTERN_C
  73. __declspec(naked)
  74. BOOL WINAPI ForwardrCryptCATPersistStore(IN HANDLE hCatalog)
  75. {
  76. __asm {
  77. jmp CryptCATPersistStore
  78. }
  79. }
  80. EXTERN_C
  81. __declspec(naked)
  82. CRYPTCATATTRIBUTE * WINAPI ForwardrCryptCATGetCatAttrInfo(IN HANDLE hCatalog,
  83. IN LPWSTR pwszReferenceTag)
  84. {
  85. __asm {
  86. jmp CryptCATGetCatAttrInfo
  87. }
  88. }
  89. EXTERN_C
  90. __declspec(naked)
  91. CRYPTCATATTRIBUTE * WINAPI ForwardrCryptCATPutCatAttrInfo(IN HANDLE hCatalog,
  92. IN LPWSTR pwszReferenceTag,
  93. IN DWORD dwAttrTypeAndAction,
  94. IN DWORD cbData,
  95. IN BYTE *pbData)
  96. {
  97. __asm {
  98. jmp CryptCATPutCatAttrInfo
  99. }
  100. }
  101. EXTERN_C
  102. __declspec(naked)
  103. CRYPTCATATTRIBUTE * WINAPI ForwardrCryptCATEnumerateCatAttr(IN HANDLE hCatalog,
  104. IN CRYPTCATATTRIBUTE *pPrevAttr)
  105. {
  106. __asm {
  107. jmp CryptCATEnumerateCatAttr
  108. }
  109. }
  110. EXTERN_C
  111. __declspec(naked)
  112. CRYPTCATMEMBER * WINAPI ForwardrCryptCATGetMemberInfo(IN HANDLE hCatalog,
  113. IN LPWSTR pwszReferenceTag)
  114. {
  115. __asm {
  116. jmp CryptCATGetMemberInfo
  117. }
  118. }
  119. EXTERN_C
  120. __declspec(naked)
  121. CRYPTCATMEMBER * WINAPI ForwardrCryptCATPutMemberInfo(IN HANDLE hCatalog,
  122. IN OPTIONAL LPWSTR pwszFileName,
  123. IN LPWSTR pwszReferenceTag,
  124. IN GUID *pgSubjectType,
  125. IN DWORD dwCertVersion,
  126. IN DWORD cbSIPIndirectData,
  127. IN BYTE *pbSIPIndirectData)
  128. {
  129. __asm {
  130. jmp CryptCATPutMemberInfo
  131. }
  132. }
  133. EXTERN_C
  134. __declspec(naked)
  135. CRYPTCATMEMBER * WINAPI ForwardrCryptCATEnumerateMember(IN HANDLE hCatalog,
  136. IN CRYPTCATMEMBER *pPrevMember)
  137. {
  138. __asm {
  139. jmp CryptCATEnumerateMember
  140. }
  141. }
  142. EXTERN_C
  143. __declspec(naked)
  144. CRYPTCATATTRIBUTE * WINAPI ForwardrCryptCATGetAttrInfo(IN HANDLE hCatalog,
  145. IN CRYPTCATMEMBER *pCatMember,
  146. IN LPWSTR pwszReferenceTag)
  147. {
  148. __asm {
  149. jmp CryptCATGetAttrInfo
  150. }
  151. }
  152. EXTERN_C
  153. __declspec(naked)
  154. CRYPTCATATTRIBUTE * WINAPI ForwardrCryptCATPutAttrInfo(IN HANDLE hCatalog,
  155. IN CRYPTCATMEMBER *pCatMember,
  156. IN LPWSTR pwszReferenceTag,
  157. IN DWORD dwAttrTypeAndAction,
  158. IN DWORD cbData,
  159. IN BYTE *pbData)
  160. {
  161. __asm {
  162. jmp CryptCATPutAttrInfo
  163. }
  164. }
  165. EXTERN_C
  166. __declspec(naked)
  167. CRYPTCATATTRIBUTE * WINAPI ForwardrCryptCATEnumerateAttr(IN HANDLE hCatalog,
  168. IN CRYPTCATMEMBER *pCatMember,
  169. IN CRYPTCATATTRIBUTE *pPrevAttr)
  170. {
  171. __asm {
  172. jmp CryptCATEnumerateAttr
  173. }
  174. }
  175. EXTERN_C
  176. __declspec(naked)
  177. BOOL WINAPI ForwardrCryptCATAdminReleaseCatalogContext(IN HCATADMIN hCatAdmin,
  178. IN HCATINFO hCatInfo,
  179. IN DWORD dwFlags)
  180. {
  181. __asm {
  182. jmp CryptCATAdminReleaseCatalogContext
  183. }
  184. }
  185. EXTERN_C
  186. __declspec(naked)
  187. CRYPTCATCDF * WINAPI ForwardrCryptCATCDFOpen(IN LPWSTR pwszFilePath,
  188. IN OPTIONAL PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError)
  189. {
  190. __asm {
  191. jmp CryptCATCDFOpen
  192. }
  193. }
  194. EXTERN_C
  195. __declspec(naked)
  196. BOOL WINAPI ForwardrCryptCATCDFClose(IN CRYPTCATCDF *pCDF)
  197. {
  198. __asm {
  199. jmp CryptCATCDFClose
  200. }
  201. }
  202. EXTERN_C
  203. __declspec(naked)
  204. CRYPTCATATTRIBUTE * WINAPI ForwardrCryptCATCDFEnumCatAttributes(CRYPTCATCDF *pCDF,
  205. CRYPTCATATTRIBUTE *pPrevAttr,
  206. PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError)
  207. {
  208. __asm {
  209. jmp CryptCATCDFEnumCatAttributes
  210. }
  211. }
  212. EXTERN_C
  213. __declspec(naked)
  214. CRYPTCATMEMBER * WINAPI ForwardrCryptCATCDFEnumMembers(IN CRYPTCATCDF *pCDF,
  215. IN CRYPTCATMEMBER *pPrevMember,
  216. IN OPTIONAL PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError)
  217. {
  218. __asm {
  219. jmp CryptCATCDFEnumMembers
  220. }
  221. }
  222. EXTERN_C
  223. __declspec(naked)
  224. CRYPTCATATTRIBUTE *WINAPI ForwardrCryptCATCDFEnumAttributes(IN CRYPTCATCDF *pCDF,
  225. IN CRYPTCATMEMBER *pMember,
  226. IN CRYPTCATATTRIBUTE *pPrevAttr,
  227. IN OPTIONAL PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError)
  228. {
  229. __asm {
  230. jmp CryptCATCDFEnumAttributes
  231. }
  232. }
  233. EXTERN_C
  234. __declspec(naked)
  235. BOOL WINAPI ForwardrCryptCATAdminAcquireContext(OUT HCATADMIN *phCatAdmin,
  236. IN const GUID *pgSubsystem,
  237. IN DWORD dwFlags)
  238. {
  239. __asm {
  240. jmp CryptCATAdminAcquireContext
  241. }
  242. }
  243. EXTERN_C
  244. __declspec(naked)
  245. BOOL WINAPI ForwardrCryptCATAdminReleaseContext(IN HCATADMIN hCatAdmin,
  246. IN DWORD dwFlags)
  247. {
  248. __asm {
  249. jmp CryptCATAdminReleaseContext
  250. }
  251. }
  252. EXTERN_C
  253. __declspec(naked)
  254. HCATINFO WINAPI ForwardrCryptCATAdminEnumCatalogFromHash(IN HCATADMIN hCatAdmin,
  255. IN BYTE *pbHash,
  256. IN DWORD cbHash,
  257. IN DWORD dwFlags,
  258. IN OUT HCATINFO *phPrevCatInfo)
  259. {
  260. __asm {
  261. jmp CryptCATAdminEnumCatalogFromHash
  262. }
  263. }
  264. EXTERN_C
  265. __declspec(naked)
  266. BOOL WINAPI ForwardrCryptCATAdminCalcHashFromFileHandle(IN HANDLE hFile,
  267. IN OUT DWORD *pcbHash,
  268. OUT OPTIONAL BYTE *pbHash,
  269. IN DWORD dwFlags)
  270. {
  271. __asm {
  272. jmp CryptCATAdminCalcHashFromFileHandle
  273. }
  274. }
  275. EXTERN_C
  276. __declspec(naked)
  277. BOOL WINAPI ForwardrCryptCATCatalogInfoFromContext(IN HCATINFO hCatInfo,
  278. IN OUT CATALOG_INFO *psCatInfo,
  279. IN DWORD dwFlags)
  280. {
  281. __asm {
  282. jmp CryptCATCatalogInfoFromContext
  283. }
  284. }
  285. EXTERN_C
  286. __declspec(naked)
  287. HCATINFO WINAPI ForwardrCryptCATAdminAddCatalog(IN HCATADMIN hCatAdmin,
  288. IN WCHAR *pwszCatalogFile,
  289. IN OPTIONAL WCHAR *pwszSelectBaseName,
  290. IN DWORD dwFlags)
  291. {
  292. __asm {
  293. jmp CryptCATAdminAddCatalog
  294. }
  295. }
  296. EXTERN_C
  297. __declspec(naked)
  298. BOOL WINAPI ForwardrIsCatalogFile(IN OPTIONAL HANDLE hFile,
  299. IN OPTIONAL WCHAR *pwszFileName)
  300. {
  301. __asm {
  302. jmp IsCatalogFile
  303. }
  304. }
  305. EXTERN_C
  306. BOOL WINAPI
  307. CatalogCompactHashDatabase (
  308. IN LPCWSTR pwszDbLock,
  309. IN LPCWSTR pwszDbDirectory,
  310. IN LPCWSTR pwszDbName,
  311. IN OPTIONAL LPCWSTR pwszUnwantedCatalog
  312. );
  313. EXTERN_C
  314. __declspec(naked)
  315. void
  316. ForwardrCatalogCompactHashDatabase (
  317. IN LPCWSTR pwszDbLock,
  318. IN LPCWSTR pwszDbDirectory,
  319. IN LPCWSTR pwszDbName,
  320. IN OPTIONAL LPCWSTR pwszUnwantedCatalog
  321. )
  322. {
  323. __asm {
  324. jmp CatalogCompactHashDatabase
  325. }
  326. }
  327. EXTERN_C
  328. LPWSTR WINAPI CryptCATCDFEnumMembersByCDFTag(CRYPTCATCDF *pCDF, LPWSTR pwszPrevCDFTag,
  329. PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError,
  330. CRYPTCATMEMBER** ppMember);
  331. EXTERN_C
  332. __declspec(naked)
  333. LPWSTR WINAPI ForwardrCryptCATCDFEnumMembersByCDFTag(CRYPTCATCDF *pCDF, LPWSTR pwszPrevCDFTag,
  334. PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError,
  335. CRYPTCATMEMBER** ppMember)
  336. {
  337. __asm {
  338. jmp CryptCATCDFEnumMembersByCDFTag
  339. }
  340. }
  341. EXTERN_C
  342. LPWSTR WINAPI CryptCATCDFEnumMembersByCDFTagEx(CRYPTCATCDF *pCDF, LPWSTR pwszPrevCDFTag,
  343. PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError,
  344. CRYPTCATMEMBER** ppMember, BOOL fContinueOnError,
  345. LPVOID pvReserved);
  346. EXTERN_C
  347. __declspec(naked)
  348. LPWSTR WINAPI ForwardrCryptCATCDFEnumMembersByCDFTagEx(CRYPTCATCDF *pCDF, LPWSTR pwszPrevCDFTag,
  349. PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError,
  350. CRYPTCATMEMBER** ppMember, BOOL fContinueOnError,
  351. LPVOID pvReserved)
  352. {
  353. __asm {
  354. jmp CryptCATCDFEnumMembersByCDFTagEx
  355. }
  356. }
  357. EXTERN_C
  358. CRYPTCATATTRIBUTE * WINAPI CryptCATCDFEnumAttributesWithCDFTag(CRYPTCATCDF *pCDF, LPWSTR pwszMemberTag, CRYPTCATMEMBER *pMember,
  359. CRYPTCATATTRIBUTE *pPrevAttr,
  360. PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError);
  361. EXTERN_C
  362. __declspec(naked)
  363. CRYPTCATATTRIBUTE * WINAPI ForwardrCryptCATCDFEnumAttributesWithCDFTag(CRYPTCATCDF *pCDF, LPWSTR pwszMemberTag, CRYPTCATMEMBER *pMember,
  364. CRYPTCATATTRIBUTE *pPrevAttr,
  365. PFN_CDF_PARSE_ERROR_CALLBACK pfnParseError)
  366. {
  367. __asm {
  368. jmp CryptCATCDFEnumAttributesWithCDFTag
  369. }
  370. }
  371. EXTERN_C
  372. BOOL MsCatConstructHashTag (IN DWORD cbDigest, IN LPBYTE pbDigest, OUT LPWSTR* ppwszHashTag);
  373. EXTERN_C
  374. __declspec(naked)
  375. BOOL ForwardrMsCatConstructHashTag (IN DWORD cbDigest, IN LPBYTE pbDigest, OUT LPWSTR* ppwszHashTag)
  376. {
  377. __asm {
  378. jmp MsCatConstructHashTag
  379. }
  380. }
  381. EXTERN_C
  382. VOID MsCatFreeHashTag (IN LPWSTR pwszHashTag);
  383. EXTERN_C
  384. __declspec(naked)
  385. VOID ForwardrMsCatFreeHashTag (IN LPWSTR pwszHashTag)
  386. {
  387. __asm {
  388. jmp MsCatFreeHashTag
  389. }
  390. }
  391. BOOL WINAPI CryptCATVerifyMember(HANDLE hCatalog,
  392. CRYPTCATMEMBER *pCatMember,
  393. HANDLE hFileOrMemory);
  394. __declspec(naked)
  395. BOOL WINAPI ForwardrCryptCATVerifyMember(HANDLE hCatalog,
  396. CRYPTCATMEMBER *pCatMember,
  397. HANDLE hFileOrMemory)
  398. {
  399. __asm {
  400. jmp CryptCATVerifyMember
  401. }
  402. }
  403. #else
  404. static void Dummy()
  405. {
  406. }
  407. #endif