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.

307 lines
7.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: stgdthk.cxx (16 bit target)
  7. //
  8. // Contents: Storage APIs that are directly thunked
  9. //
  10. // History: 17-Dec-93 JohannP Created
  11. //
  12. //--------------------------------------------------------------------------
  13. #include <headers.cxx>
  14. #pragma hdrstop
  15. #include <call32.hxx>
  16. #include <apilist.hxx>
  17. //+---------------------------------------------------------------------------
  18. //
  19. // Function: Straight thunk routines
  20. //
  21. // Synopsis: The following routines thunk straight through
  22. //
  23. // History: 24-Feb-94 DrewB Created
  24. //
  25. //----------------------------------------------------------------------------
  26. STDAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void FAR* FAR* ppv)
  27. {
  28. /* Relies on the fact that storage and ole2.dll both use the
  29. same DllGetClassObject in ole32.dll */
  30. return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_DllGetClassObject),
  31. PASCAL_STACK_PTR(clsid));
  32. }
  33. //+---------------------------------------------------------------------------
  34. //
  35. // Function: StgCreateDocfile, Remoted
  36. //
  37. // Synopsis:
  38. //
  39. // Effects:
  40. //
  41. // Arguments: [pwcsName] --
  42. // [grfMode] --
  43. // [reserved] --
  44. // [ppstgOpen] --
  45. //
  46. // Requires:
  47. //
  48. // Returns:
  49. //
  50. // Signals:
  51. //
  52. // Modifies:
  53. //
  54. // Algorithm:
  55. //
  56. // History: 2-28-94 DrewB Created
  57. //
  58. // Notes:
  59. //
  60. //----------------------------------------------------------------------------
  61. STDAPI StgCreateDocfile(const char FAR* pwcsName,
  62. DWORD grfMode,
  63. DWORD reserved,
  64. IStorage FAR * FAR *ppstgOpen)
  65. {
  66. return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgCreateDocfile),
  67. PASCAL_STACK_PTR(pwcsName));
  68. }
  69. //+---------------------------------------------------------------------------
  70. //
  71. // Function: StgCreateDocfileOnILockBytes, Remoted
  72. //
  73. // Synopsis:
  74. //
  75. // Effects:
  76. //
  77. // Arguments: [plkbyt] --
  78. // [grfMode] --
  79. // [reserved] --
  80. // [ppstgOpen] --
  81. //
  82. // Requires:
  83. //
  84. // Returns:
  85. //
  86. // Signals:
  87. //
  88. // Modifies:
  89. //
  90. // Algorithm:
  91. //
  92. // History: 2-28-94 DrewB Created
  93. //
  94. // Notes:
  95. //
  96. //----------------------------------------------------------------------------
  97. STDAPI StgCreateDocfileOnILockBytes(ILockBytes FAR *plkbyt,
  98. DWORD grfMode,
  99. DWORD reserved,
  100. IStorage FAR * FAR *ppstgOpen)
  101. {
  102. return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgCreateDocfileOnILockBytes),
  103. PASCAL_STACK_PTR(plkbyt));
  104. }
  105. //+---------------------------------------------------------------------------
  106. //
  107. // Function: StgOpenStorage, Remoted
  108. //
  109. // Synopsis:
  110. //
  111. // Effects:
  112. //
  113. // Arguments: [pwcsName] --
  114. // [pstgPriority] --
  115. // [grfMode] --
  116. // [snbExclude] --
  117. // [reserved] --
  118. // [ppstgOpen] --
  119. //
  120. // Requires:
  121. //
  122. // Returns:
  123. //
  124. // Signals:
  125. //
  126. // Modifies:
  127. //
  128. // Algorithm:
  129. //
  130. // History: 2-28-94 DrewB Created
  131. //
  132. // Notes:
  133. //
  134. //----------------------------------------------------------------------------
  135. STDAPI StgOpenStorage(const char FAR* pwcsName,
  136. IStorage FAR *pstgPriority,
  137. DWORD grfMode,
  138. SNB snbExclude,
  139. DWORD reserved,
  140. IStorage FAR * FAR *ppstgOpen)
  141. {
  142. // STGM_CREATE and STGM_CONVERT are illegal for open calls
  143. // 16-bit code did not enforce this, so mask out these flags
  144. // before passing grfMode on
  145. grfMode &= ~(STGM_CREATE | STGM_CONVERT);
  146. return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgOpenStorage),
  147. PASCAL_STACK_PTR(pwcsName));
  148. }
  149. //+---------------------------------------------------------------------------
  150. //
  151. // Function: StgOpenStorageOnILockBytes, Remoted
  152. //
  153. // Synopsis:
  154. //
  155. // Effects:
  156. //
  157. // Arguments: [plkbyt] --
  158. // [pstgPriority] --
  159. // [grfMode] --
  160. // [snbExclude] --
  161. // [reserved] --
  162. // [ppstgOpen] --
  163. //
  164. // Requires:
  165. //
  166. // Returns:
  167. //
  168. // Signals:
  169. //
  170. // Modifies:
  171. //
  172. // Algorithm:
  173. //
  174. // History: 2-28-94 DrewB Created
  175. //
  176. // Notes:
  177. //
  178. //----------------------------------------------------------------------------
  179. STDAPI StgOpenStorageOnILockBytes(ILockBytes FAR *plkbyt,
  180. IStorage FAR *pstgPriority,
  181. DWORD grfMode,
  182. SNB snbExclude,
  183. DWORD reserved,
  184. IStorage FAR * FAR *ppstgOpen)
  185. {
  186. // STGM_CREATE and STGM_CONVERT are illegal for open calls
  187. // 16-bit code did not enforce this, so mask out these flags
  188. // before passing grfMode on
  189. grfMode &= ~(STGM_CREATE | STGM_CONVERT);
  190. return
  191. (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgOpenStorageOnILockBytes),
  192. PASCAL_STACK_PTR(plkbyt));
  193. }
  194. //+---------------------------------------------------------------------------
  195. //
  196. // Function: StgIsStorageFile, Remoted
  197. //
  198. // Synopsis:
  199. //
  200. // Effects:
  201. //
  202. // Arguments: [pwcsName] --
  203. //
  204. // Requires:
  205. //
  206. // Returns:
  207. //
  208. // Signals:
  209. //
  210. // Modifies:
  211. //
  212. // Algorithm:
  213. //
  214. // History: 2-28-94 DrewB Created
  215. //
  216. // Notes:
  217. //
  218. //----------------------------------------------------------------------------
  219. STDAPI StgIsStorageFile(const char FAR* pwcsName)
  220. {
  221. //
  222. // MSPUB 2.0a hack - We call the "CheckInit" version because they forgot
  223. // to call CoInitialize/OleInitialize first.
  224. //
  225. return
  226. (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgIsStorageFile),
  227. PASCAL_STACK_PTR(pwcsName));
  228. }
  229. //+---------------------------------------------------------------------------
  230. //
  231. // Function: StgIsStorageILockBytes, Remoted
  232. //
  233. // Synopsis:
  234. //
  235. // Effects:
  236. //
  237. // Arguments: [plkbyt] --
  238. //
  239. // Requires:
  240. //
  241. // Returns:
  242. //
  243. // Signals:
  244. //
  245. // Modifies:
  246. //
  247. // Algorithm:
  248. //
  249. // History: 2-28-94 DrewB Created
  250. //
  251. // Notes:
  252. //
  253. //----------------------------------------------------------------------------
  254. STDAPI StgIsStorageILockBytes(ILockBytes FAR* plkbyt)
  255. {
  256. return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgIsStorageILockBytes),
  257. PASCAL_STACK_PTR(plkbyt));
  258. }
  259. //+---------------------------------------------------------------------------
  260. //
  261. // Function: StgSetTimes, Remoted
  262. //
  263. // Synopsis:
  264. //
  265. // Effects:
  266. //
  267. // Arguments: [lpszName] --
  268. // [pctime] --
  269. // [patime] --
  270. // [pmtime] --
  271. //
  272. // Requires:
  273. //
  274. // Returns:
  275. //
  276. // Signals:
  277. //
  278. // Modifies:
  279. //
  280. // Algorithm:
  281. //
  282. // History: 2-28-94 DrewB Created
  283. //
  284. // Notes:
  285. //
  286. //----------------------------------------------------------------------------
  287. STDAPI StgSetTimes(char const FAR* lpszName,
  288. FILETIME const FAR* pctime,
  289. FILETIME const FAR* patime,
  290. FILETIME const FAR* pmtime)
  291. {
  292. return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgSetTimes),
  293. PASCAL_STACK_PTR(lpszName));
  294. }