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.

380 lines
8.3 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: ERROR.C
  3. *
  4. * PURPOSE: Contains routines which are commonly used, as method functions, by
  5. * bm.c, mf.c and dib.c. These routines do nothing more than
  6. * returning an error code.
  7. *
  8. * Created: November 1990
  9. *
  10. * Copyright (c) 1990, 1991 Microsoft Corporation
  11. *
  12. * History:
  13. * Raor, Srinik (11/20/90) Original
  14. *
  15. \***************************************************************************/
  16. #include <windows.h>
  17. #include "dll.h"
  18. #include "pict.h"
  19. OLESTATUS FARINTERNAL ErrQueryRelease (
  20. LPOLEOBJECT lpobj
  21. ){
  22. UNREFERENCED_PARAMETER(lpobj);
  23. return OLE_ERROR_STATIC;
  24. }
  25. OLE_RELEASE_METHOD FARINTERNAL ErrQueryReleaseMethod (
  26. LPOLEOBJECT lpobj
  27. ){
  28. UNREFERENCED_PARAMETER(lpobj);
  29. return OLE_ERROR_STATIC;
  30. }
  31. OLESTATUS FARINTERNAL ErrPlay (
  32. LPOLEOBJECT lpobj,
  33. UINT verb,
  34. BOOL fAct,
  35. BOOL fShow
  36. ){
  37. UNREFERENCED_PARAMETER(lpobj);
  38. UNREFERENCED_PARAMETER(verb);
  39. UNREFERENCED_PARAMETER(fAct);
  40. UNREFERENCED_PARAMETER(fShow);
  41. return OLE_ERROR_STATIC;
  42. }
  43. OLESTATUS FARINTERNAL ErrShow (
  44. LPOLEOBJECT lpobj,
  45. BOOL fAct
  46. ){
  47. UNREFERENCED_PARAMETER(lpobj);
  48. UNREFERENCED_PARAMETER(fAct);
  49. return OLE_ERROR_STATIC;
  50. }
  51. OLESTATUS FARINTERNAL ErrAbort (
  52. LPOLEOBJECT lpobj
  53. ){
  54. UNREFERENCED_PARAMETER(lpobj);
  55. return OLE_ERROR_STATIC;
  56. }
  57. OLESTATUS FARINTERNAL ErrCopyFromLink(
  58. LPOLEOBJECT lpobj,
  59. LPOLECLIENT lpclient,
  60. LHCLIENTDOC lhclientdoc,
  61. OLE_LPCSTR lpobjname,
  62. LPOLEOBJECT FAR * lplpobj
  63. ){
  64. UNREFERENCED_PARAMETER(lpobj);
  65. UNREFERENCED_PARAMETER(lpclient);
  66. UNREFERENCED_PARAMETER(lhclientdoc);
  67. UNREFERENCED_PARAMETER(lpobjname);
  68. UNREFERENCED_PARAMETER(lplpobj);
  69. return OLE_ERROR_STATIC;
  70. }
  71. OLESTATUS FARINTERNAL ErrSetHostNames (
  72. LPOLEOBJECT lpobj,
  73. OLE_LPCSTR lpclientName,
  74. OLE_LPCSTR lpdocName
  75. ){
  76. UNREFERENCED_PARAMETER(lpobj);
  77. UNREFERENCED_PARAMETER(lpclientName);
  78. UNREFERENCED_PARAMETER(lpdocName);
  79. return OLE_ERROR_STATIC;
  80. }
  81. OLESTATUS FARINTERNAL ErrSetTargetDevice (
  82. LPOLEOBJECT lpobj,
  83. HANDLE hDevInfo
  84. ){
  85. UNREFERENCED_PARAMETER(lpobj);
  86. UNREFERENCED_PARAMETER(hDevInfo);
  87. return OLE_ERROR_STATIC;
  88. }
  89. OLESTATUS FARINTERNAL ErrSetColorScheme (
  90. LPOLEOBJECT lpobj,
  91. OLE_CONST LOGPALETTE FAR* lplogpal
  92. ){
  93. UNREFERENCED_PARAMETER(lpobj);
  94. UNREFERENCED_PARAMETER(lplogpal);
  95. return OLE_ERROR_STATIC;
  96. }
  97. OLESTATUS FARINTERNAL ErrSetBounds(
  98. LPOLEOBJECT lpobj,
  99. OLE_CONST RECT FAR* lprc
  100. ){
  101. UNREFERENCED_PARAMETER(lpobj);
  102. UNREFERENCED_PARAMETER(lprc);
  103. return OLE_ERROR_MEMORY;
  104. }
  105. OLESTATUS FARINTERNAL ErrQueryOpen (
  106. LPOLEOBJECT lpobj
  107. ){
  108. UNREFERENCED_PARAMETER(lpobj);
  109. return OLE_ERROR_STATIC; // static object
  110. }
  111. OLESTATUS FARINTERNAL ErrActivate (
  112. LPOLEOBJECT lpobj,
  113. UINT verb,
  114. BOOL fShow,
  115. BOOL fAct,
  116. HWND hWnd,
  117. OLE_CONST RECT FAR* lprc
  118. ){
  119. UNREFERENCED_PARAMETER(lpobj);
  120. UNREFERENCED_PARAMETER(verb);
  121. UNREFERENCED_PARAMETER(fShow);
  122. UNREFERENCED_PARAMETER(fAct);
  123. UNREFERENCED_PARAMETER(hWnd);
  124. UNREFERENCED_PARAMETER(lprc);
  125. return OLE_ERROR_STATIC; // static object
  126. }
  127. OLESTATUS FARINTERNAL ErrEdit (
  128. LPOLEOBJECT lpobj,
  129. BOOL fShow,
  130. HWND hWnd,
  131. LPRECT lprc
  132. ){
  133. UNREFERENCED_PARAMETER(lpobj);
  134. UNREFERENCED_PARAMETER(fShow);
  135. UNREFERENCED_PARAMETER(hWnd);
  136. UNREFERENCED_PARAMETER(lprc);
  137. return OLE_ERROR_STATIC; // static object
  138. }
  139. OLESTATUS FARINTERNAL ErrClose (
  140. LPOLEOBJECT lpobj
  141. ){
  142. UNREFERENCED_PARAMETER(lpobj);
  143. return OLE_ERROR_STATIC; // static object
  144. }
  145. OLESTATUS FARINTERNAL ErrUpdate (
  146. LPOLEOBJECT lpobj
  147. ){
  148. UNREFERENCED_PARAMETER(lpobj);
  149. return OLE_ERROR_STATIC; // static object
  150. }
  151. OLESTATUS FARINTERNAL ErrReconnect (
  152. LPOLEOBJECT lpobj
  153. ){
  154. UNREFERENCED_PARAMETER(lpobj);
  155. return OLE_ERROR_STATIC; // static object
  156. }
  157. OLESTATUS FARINTERNAL ErrSetData (
  158. LPOLEOBJECT lpobj,
  159. OLECLIPFORMAT cfFormat,
  160. HANDLE hData
  161. ){
  162. UNREFERENCED_PARAMETER(lpobj);
  163. UNREFERENCED_PARAMETER(cfFormat);
  164. UNREFERENCED_PARAMETER(hData);
  165. return OLE_ERROR_MEMORY;
  166. }
  167. OLESTATUS FARINTERNAL ErrReadFromStream (
  168. LPOLEOBJECT lpobj,
  169. OLECLIPFORMAT cfFormat,
  170. LPOLESTREAM lpstream
  171. ){
  172. UNREFERENCED_PARAMETER(lpobj);
  173. UNREFERENCED_PARAMETER(cfFormat);
  174. UNREFERENCED_PARAMETER(lpstream);
  175. return OLE_ERROR_STREAM;
  176. }
  177. OLESTATUS FARINTERNAL ErrQueryOutOfDate (
  178. LPOLEOBJECT lpobj
  179. ){
  180. UNREFERENCED_PARAMETER(lpobj);
  181. return OLE_OK;
  182. }
  183. OLESTATUS FARINTERNAL ErrObjectConvert (
  184. LPOLEOBJECT lpobj,
  185. OLE_LPCSTR lpprotocol,
  186. LPOLECLIENT lpclient,
  187. LHCLIENTDOC lhclientdoc,
  188. OLE_LPCSTR lpobjname,
  189. LPOLEOBJECT FAR * lplpobj
  190. ){
  191. UNREFERENCED_PARAMETER(lpobj);
  192. UNREFERENCED_PARAMETER(lpprotocol);
  193. UNREFERENCED_PARAMETER(lpclient);
  194. UNREFERENCED_PARAMETER(lhclientdoc);
  195. UNREFERENCED_PARAMETER(lpobjname);
  196. UNREFERENCED_PARAMETER(lplpobj);
  197. return OLE_ERROR_STATIC;
  198. }
  199. OLESTATUS FARINTERNAL ErrGetUpdateOptions (
  200. LPOLEOBJECT lpobj,
  201. OLEOPT_UPDATE FAR *lpoptions
  202. ){
  203. UNREFERENCED_PARAMETER(lpobj);
  204. UNREFERENCED_PARAMETER(lpoptions);
  205. return OLE_ERROR_STATIC;
  206. }
  207. OLESTATUS FARINTERNAL ErrSetUpdateOptions (
  208. LPOLEOBJECT lpobj,
  209. OLEOPT_UPDATE options
  210. ){
  211. UNREFERENCED_PARAMETER(lpobj);
  212. UNREFERENCED_PARAMETER(options);
  213. return OLE_ERROR_STATIC;
  214. }
  215. LPVOID FARINTERNAL ErrQueryProtocol (
  216. LPOLEOBJECT lpobj,
  217. LPCSTR lpprotocol
  218. ){
  219. UNREFERENCED_PARAMETER(lpobj);
  220. UNREFERENCED_PARAMETER(lpprotocol);
  221. return NULL;
  222. }
  223. OLESTATUS FARINTERNAL ErrRequestData (
  224. LPOLEOBJECT lpobj,
  225. OLECLIPFORMAT cfFormat
  226. ){
  227. UNREFERENCED_PARAMETER(lpobj);
  228. UNREFERENCED_PARAMETER(cfFormat);
  229. return OLE_ERROR_STATIC;
  230. }
  231. OLESTATUS FARINTERNAL ErrExecute (
  232. LPOLEOBJECT lpobj,
  233. HANDLE hData,
  234. UINT wReserved
  235. ){
  236. UNREFERENCED_PARAMETER(lpobj);
  237. UNREFERENCED_PARAMETER(hData);
  238. UNREFERENCED_PARAMETER(wReserved);
  239. return OLE_ERROR_STATIC;
  240. }
  241. OLESTATUS FARINTERNAL ErrObjectLong (
  242. LPOLEOBJECT lpobj,
  243. UINT wFlags,
  244. LPLONG lplong
  245. ){
  246. UNREFERENCED_PARAMETER(lpobj);
  247. UNREFERENCED_PARAMETER(wFlags);
  248. UNREFERENCED_PARAMETER(lplong);
  249. return OLE_ERROR_STATIC;
  250. }
  251. HANDLE FARINTERNAL DuplicateGDIdata (
  252. HANDLE hSrcData,
  253. OLECLIPFORMAT cfFormat
  254. ){
  255. if (cfFormat == CF_METAFILEPICT) {
  256. LPMETAFILEPICT lpSrcMfp;
  257. LPMETAFILEPICT lpDstMfp = NULL;
  258. HANDLE hMF = NULL;
  259. HANDLE hDstMfp = NULL;
  260. if (!(lpSrcMfp = (LPMETAFILEPICT) GlobalLock(hSrcData)))
  261. return NULL;
  262. GlobalUnlock (hSrcData);
  263. if (!(hMF = CopyMetaFile (lpSrcMfp->hMF, NULL)))
  264. return NULL;
  265. if (!(hDstMfp = GlobalAlloc (GMEM_MOVEABLE, sizeof(METAFILEPICT))))
  266. goto errMfp;
  267. if (!(lpDstMfp = (LPMETAFILEPICT) GlobalLock (hDstMfp)))
  268. goto errMfp;
  269. GlobalUnlock (hDstMfp);
  270. *lpDstMfp = *lpSrcMfp;
  271. lpDstMfp->hMF = hMF;
  272. return hDstMfp;
  273. errMfp:
  274. if (hMF)
  275. DeleteMetaFile (hMF);
  276. if (hDstMfp)
  277. GlobalFree (hDstMfp);
  278. return NULL;
  279. }
  280. if (cfFormat == CF_BITMAP) {
  281. DWORD dwSize;
  282. return BmDuplicate (hSrcData, &dwSize, NULL);
  283. }
  284. if (cfFormat == CF_DIB)
  285. return DuplicateGlobal (hSrcData, GMEM_MOVEABLE);
  286. if (cfFormat == CF_ENHMETAFILE)
  287. return CopyEnhMetaFile(hSrcData, NULL);
  288. return NULL;
  289. }