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.

606 lines
16 KiB

  1. /**************************************************************************
  2. *
  3. * - fakewife.c - Dummy functions
  4. *
  5. * Windows Intelligent Font Environment Maneger for Win32 and NT
  6. *
  7. * Author : kazuyuki Kato [ V-kazuyK ]
  8. *
  9. * History :
  10. *
  11. * 11.Nov.1993 -By- kazuyuki Kato [ V-kazuyK ]
  12. * Create it.
  13. *
  14. *************************************************************************/
  15. #include <windows.h>
  16. #include "wife.h"
  17. extern HINSTANCE hInst;
  18. typedef int (FAR PASCAL * LPLOADSTRING)(HANDLE, USHORT, LPSTR, int);
  19. typedef int (FAR PASCAL * LPMESSAGEBOX)(HWND, LPSTR, LPSTR, USHORT);
  20. typedef int (FAR cdecl * LPWSPRINTF)(LPSTR,LPSTR,...);
  21. #define IDCANCEL 2
  22. SHORT FAR PASCAL InternalWarningMessageByString(
  23. HWND hParentWindow,
  24. LPSTR szMsg,
  25. LPSTR szTitle,
  26. USHORT mode
  27. )
  28. {
  29. HANDLE hUser;
  30. LPMESSAGEBOX lpMessageBox;
  31. SHORT result;
  32. /* get instance of user.exe */
  33. hUser = GetModuleHandle("USER.EXE");
  34. if( hUser == NULL ) return(IDCANCEL);
  35. /* get procedure instance of MessageBox */
  36. lpMessageBox = (LPMESSAGEBOX)GetProcAddress( hUser, MAKEINTRESOURCE(1) );
  37. if( lpMessageBox == NULL ) return(IDCANCEL);
  38. result = (*lpMessageBox)(
  39. NULL, /* no current window handle */
  40. szMsg,
  41. szTitle,
  42. mode
  43. );
  44. return( result );
  45. }
  46. VOID NotifyNoSuport( VOID )
  47. {
  48. if ( IDNO == MiscWarningMessage( hInst, IDS_NOTSUPORTFUNCTION, IDS_WIFETITLE, MB_YESNO ))
  49. FatalAppExit( 0, NULL );
  50. // MessageBox( NULL, sz, sz2, MB_OK );
  51. // OutputDebugString( sz );
  52. }
  53. LONG FAR PASCAL FdiClaimFontFile( HFD hFD, LPSTR lpszFileName )
  54. {NotifyNoSuport();return 0;}
  55. LONG FAR PASCAL FdiConvertFontFile( HFD hFD, LPSTR lpszSrcFileName, LPSTR lpszDestDirName, LPSTR lpszResultPackName )
  56. {NotifyNoSuport();return -1L;}
  57. HFF FAR PASCAL FdiLoadFontFile( HFD hFD, LPSTR lpszPackName )
  58. {NotifyNoSuport();return -1L;}
  59. LONG FAR PASCAL FdiUnloadFontFile( HFD hFD, HFF hFF )
  60. {NotifyNoSuport();return -1L;}
  61. LONG FAR PASCAL FdiQueryFaces( HFD hFD, HFF hFF, LPIFIMETRICS lpIfiMetrics, ULONG cMetricLen, ULONG cFontCount, ULONG cStart )
  62. {NotifyNoSuport();return 0;}
  63. HFC FAR PASCAL FdiOpenFontContext( HFD hFD, HFF hFF, ULONG ulFont )
  64. {NotifyNoSuport();return 0;}
  65. LONG FAR PASCAL FdiCloseFontContext( HFD hFD, HFC hFC )
  66. {NotifyNoSuport();return 0;}
  67. LONG FAR PASCAL FdiSetFontContext( HFD hFD, HFC hFC, LPCONTEXTINFO lpContextInfo )
  68. {NotifyNoSuport();return 0;}
  69. LONG FAR PASCAL FdiQueryFaceAttr( HFD hFD, HFC hFC, ULONG iQuery, LPVOID lpBuffer, ULONG cb, LPVOID lpIndex, SHORT Start )
  70. {NotifyNoSuport();return 0;}
  71. LONG FAR PASCAL FdiQueryCharAttr( HFD hFD, HFC hFC, LPCHARATTR lpCharAttr, LPBITMAPMETRICS lpbmm )
  72. {NotifyNoSuport();return 0;}
  73. SHORT FAR PASCAL FdiControl( HFD hFD, HFC hFC, LPCONTROLTAG lpControlTag, LPVOID lpOutData )
  74. {NotifyNoSuport();return 0;}
  75. HFD FAR PASCAL MimAddFontDriver( LPSTR lpszFileName )
  76. {NotifyNoSuport();return 0;}
  77. BOOL FAR PASCAL MimRemoveFontDriver( HFD hFD )
  78. {NotifyNoSuport();return 0;}
  79. BOOL NEAR PASCAL RealRemoveFontDriver( HFD hFD )
  80. {NotifyNoSuport();return 0;}
  81. HFF FAR PASCAL MimAddFontPack( HFD hFD, LPSTR lpszPackName )
  82. {NotifyNoSuport();return 0;}
  83. BOOL FAR PASCAL MimRemoveFontPack( HFD hFD, HFF hFontPack )
  84. {NotifyNoSuport();return 0;}
  85. HFD FAR PASCAL MimEnumFontDrivers( HFD hLastDriver )
  86. {NotifyNoSuport();return 0;}
  87. HFF FAR PASCAL MimEnumFontPacks( HFD hFD, HFF hLastPack )
  88. {NotifyNoSuport();return 0;}
  89. HFC FAR PASCAL MimOpenFontContext( HFD hFD, HFF hFF, ULONG ulFont )
  90. {NotifyNoSuport();return 0;}
  91. LONG FAR PASCAL MimCloseFontContext( HFD hFD, HFF hFF, HFC hFC )
  92. {NotifyNoSuport();return 0;}
  93. SHORT FAR PASCAL MimGetInformations( MIMGETINFO_ORDER order, HFD hFD, HFF hFF, LPVOID AnswerBuffer, USHORT SizeOfBuffer )
  94. {NotifyNoSuport();return 0;}
  95. VOID FAR PASCAL MiscSetErroInfo( ULONG ErrorCode )
  96. {NotifyNoSuport();return ;}
  97. ULONG FAR PASCAL MiscGetErroInfo( VOID )
  98. {
  99. return( 0L );
  100. }
  101. /**************************Public*Routine*******************************\
  102. * SHORT FAR PASCAL MiscWarningMessage(
  103. * HANDLE hInst,
  104. * USHORT idsMsg,
  105. * USHORT idsTitle,
  106. * USHORT mode
  107. * )
  108. *
  109. * read string from resource and show it by message box
  110. *
  111. * Effects:
  112. *
  113. * Warnings:
  114. * This function is available after delayed init.
  115. *
  116. * History:
  117. * 04-Sep-1990 12:00:00 -by- Akira Kawamata [akirak]
  118. * Creation
  119. \***********************************************************************/
  120. char szTitle[256];
  121. char szMsg[256];
  122. char szNewMsg[256];
  123. SHORT FAR PASCAL MiscWarningMessage(
  124. HANDLE hInst,
  125. USHORT idsMsg,
  126. USHORT idsTitle,
  127. USHORT mode
  128. )
  129. {
  130. HANDLE hUser;
  131. LPLOADSTRING lpLoadString;
  132. SHORT result;
  133. SHORT nLength;
  134. /* get instance of user.exe */
  135. hUser = GetModuleHandle("USER.EXE");
  136. if( hUser == NULL ) return(IDCANCEL);
  137. /* get procedure instance of LoadString */
  138. lpLoadString = (LPLOADSTRING)GetProcAddress( hUser, MAKEINTRESOURCE(176) );
  139. if( lpLoadString == NULL ) return(IDCANCEL);
  140. /* load message string */
  141. nLength = (*lpLoadString)( hInst, idsMsg, szMsg, sizeof(szMsg) );
  142. if( nLength == sizeof(szMsg) ){
  143. szMsg[sizeof(szMsg)-1] = '\0';
  144. }
  145. /* load title string */
  146. nLength = (*lpLoadString)( hInst, idsTitle, szTitle, sizeof(szTitle) );
  147. if( nLength == sizeof(szTitle) ){
  148. szMsg[sizeof(szTitle)-1] = '\0';
  149. }
  150. result = InternalWarningMessageByString(
  151. NULL, /* no current window handle */
  152. szMsg,
  153. szTitle,
  154. mode
  155. );
  156. return( result );
  157. }
  158. /**************************Public*Routine*******************************\
  159. * SHORT FAR PASCAL MiscWarningMessageWithArgument(
  160. * HANDLE hInst,
  161. * USHORT idsMsg,
  162. * USHORT idsTitle,
  163. * LPSTR lpszArgument
  164. * USHORT mode
  165. * )
  166. *
  167. * read string from resource and conbine argument,
  168. * then show it by message box
  169. *
  170. * Effects:
  171. *
  172. * Warnings:
  173. * This function is available after delayed init.
  174. * idsMsg must include only one "%s". if it's not "%s" or many % is appear,
  175. * this function wouldn't work right.
  176. *
  177. * History:
  178. * 04-Sep-1990 12:00:00 -by- Akira Kawamata [akirak]
  179. * Creation
  180. \***********************************************************************/
  181. SHORT FAR PASCAL MiscWarningMessageWithArgument(
  182. HANDLE hInst,
  183. USHORT idsMsg,
  184. USHORT idsTitle,
  185. LPSTR lpszArgument,
  186. USHORT mode
  187. )
  188. {
  189. HANDLE hUser;
  190. LPLOADSTRING lpLoadString;
  191. LPWSPRINTF lpwsprintf;
  192. SHORT result;
  193. SHORT nLength;
  194. /* get instance of user.exe */
  195. hUser = GetModuleHandle("USER.EXE");
  196. if( hUser == NULL ) return(IDCANCEL);
  197. /* get procedure instance of LoadString */
  198. lpLoadString = (LPLOADSTRING)GetProcAddress( hUser, MAKEINTRESOURCE(176) );
  199. if( lpLoadString == NULL ) return(IDCANCEL);
  200. /* get procedure instance of wsprintf */
  201. lpwsprintf = (LPWSPRINTF)GetProcAddress( hUser, MAKEINTRESOURCE(420) );
  202. if( lpwsprintf == NULL ) return(IDCANCEL);
  203. /* load message string */
  204. nLength = (*lpLoadString)( hInst, idsMsg, szMsg, sizeof(szMsg) );
  205. if( nLength == sizeof(szMsg) ){
  206. szMsg[sizeof(szMsg)-1] = '\0';
  207. }
  208. /* load title string */
  209. nLength = (*lpLoadString)( hInst, idsTitle, szTitle, sizeof(szTitle) );
  210. if( nLength == sizeof(szTitle) ){
  211. szMsg[sizeof(szTitle)-1] = '\0';
  212. }
  213. (*lpwsprintf)(szNewMsg, szMsg, lpszArgument );
  214. result = InternalWarningMessageByString(
  215. NULL, /* no current window handle */
  216. szNewMsg,
  217. szTitle,
  218. mode
  219. );
  220. return( result );
  221. }
  222. VOID FAR PASCAL MiscTrancateString(
  223. LPSTR lpszStr,
  224. SHORT length,
  225. SHORT CharSet
  226. )
  227. {NotifyNoSuport();return ;}
  228. USHORT FAR PASCAL ubstrlen( LPUBCHAR cp )
  229. {NotifyNoSuport();return 0;}
  230. LPUBCHAR FAR PASCAL ubstrcpy( LPUBCHAR dst, LPUBCHAR src )
  231. {NotifyNoSuport();return 0;}
  232. LPUBCHAR FAR PASCAL ubstrncpy( LPUBCHAR dst, LPUBCHAR src, USHORT limit )
  233. {NotifyNoSuport();return 0;}
  234. LPUBCHAR FAR PASCAL ubstrcat( LPUBCHAR dst, LPUBCHAR src )
  235. {NotifyNoSuport();return 0;}
  236. SHORT FAR PASCAL ubstrcmp( LPUBCHAR str1, LPUBCHAR str2 )
  237. {NotifyNoSuport();return 0;}
  238. USHORT FAR PASCAL AscizToUz(
  239. LPUBCHAR dst,
  240. LPSTR src,
  241. USHORT limit,
  242. CHAR_SET CharSet
  243. )
  244. {NotifyNoSuport();return 0;}
  245. USHORT FAR PASCAL UzToAsciz(
  246. LPSTR dst,
  247. LPUBCHAR src,
  248. USHORT limit
  249. )
  250. {NotifyNoSuport();return 0;}
  251. SHORT FAR PASCAL FcmCalcByteWidth( SHORT nBitWidth )
  252. {NotifyNoSuport();return 0;}
  253. HFB FAR PASCAL FcmEnumFontBuffers( HFB hLastBuffer )
  254. {NotifyNoSuport();return 0;}
  255. BOOL FAR PASCAL FcmValidateFC( HFB hFB )
  256. {NotifyNoSuport();return 0;}
  257. BOOL FAR PASCAL FcmUnvalidateFC( HFB hFB )
  258. {NotifyNoSuport();return 0;}
  259. HFB FAR PASCAL FcmCreateCacheBuffer(
  260. HFD hFD,
  261. HFF hFF,
  262. ULONG ulFont,
  263. LPVOID lpXform,
  264. USHORT usMinorCharSet,
  265. USHORT usAttribute
  266. )
  267. {NotifyNoSuport();return 0;}
  268. BOOL FAR PASCAL FcmDeleteCacheBuffer( HFB hFB )
  269. {NotifyNoSuport();return 0;}
  270. SHORT FAR PASCAL FcmForceCacheIn( HFB hFB, LPUBCHAR lpubStr )
  271. {NotifyNoSuport();return 0;}
  272. HFC FAR PASCAL FcmGetFontContext( HFB hFB )
  273. {NotifyNoSuport();return 0;}
  274. USHORT FAR PASCAL FcmGetEUDCLeadByteRange( HFB hFB )
  275. {NotifyNoSuport();return 0;}
  276. HFB FAR PASCAL FcmGetEUDCFB( HFB hFB )
  277. {NotifyNoSuport();return 0;}
  278. VOID FAR PASCAL MapWifeFont(
  279. LPLOGFONT lpLogFont,
  280. LPVOID lpMapResult)
  281. {NotifyNoSuport();return ;}
  282. WORD FAR PASCAL MiscRealizeWifeFont(
  283. LPLOGFONT lpLogFont,
  284. LPVOID lpExtFont,
  285. LPVOID lpTextXform)
  286. {NotifyNoSuport();return 0;}
  287. BOOL FAR PASCAL MiscDeleteWifeFont( LPVOID lpExtFont)
  288. {NotifyNoSuport();return 0;}
  289. VOID FAR PASCAL FillFontInfo(
  290. LPVOID lpExtFont,
  291. LPIFIMETRICS lpIFIMetrics,
  292. HFD hFD,
  293. HFF hFF,
  294. LONG MetricsOrder
  295. )
  296. {NotifyNoSuport();return ;}
  297. SHORT FAR PASCAL FcmRequestImages(
  298. HFB hFB,
  299. LPVOID AnswerBuffer,
  300. short length
  301. )
  302. {NotifyNoSuport();return 0;}
  303. BOOL FAR PASCAL FcmReleaseImages(
  304. HFB hFB,
  305. LPVOID AnswerBuffer,
  306. short length
  307. )
  308. {NotifyNoSuport();return 0;}
  309. LPVOID FAR PASCAL MiscAddHugePtr( LPVOID src, ULONG offset )
  310. {NotifyNoSuport();return 0;}
  311. USHORT FAR PASCAL MiscGetSegmentIncrement( VOID )
  312. {NotifyNoSuport();return 0;}
  313. HFB FAR PASCAL FcmRequestDefaultFB(
  314. LPVOID lpFont,
  315. LPVOID lpTextXform
  316. )
  317. {NotifyNoSuport();return 0;}
  318. BOOL FAR PASCAL FcmReleaseDefaultFB( HFB hFB )
  319. {NotifyNoSuport();return 0;}
  320. DWORD FAR PASCAL FcmCalculateTextExtent(
  321. HFB hFB,
  322. LPSTR lpString,
  323. short count,
  324. LPVOID lpFont,
  325. LPVOID lpvoid,
  326. LPVOID lpXform,
  327. LPSHORT lpCharWidths,
  328. USHORT usMode
  329. )
  330. {NotifyNoSuport();return 0;}
  331. SHORT FAR PASCAL FcmCalculateOutputPositions(
  332. HFB hFB,
  333. LPVOID lpFcmCharacteristics,
  334. SHORT nArrayLength,
  335. LPSHORT lpx,
  336. LPSHORT lpy,
  337. LPRECT lpClipRect,
  338. LPSTR FAR * lplpString,
  339. LPSHORT lpcount,
  340. LPVOID lpFont,
  341. LPVOID lpDrawMode,
  342. LPVOID lpXform,
  343. LPSHORT FAR * lplpCharWidths,
  344. USHORT usMode
  345. )
  346. {NotifyNoSuport();return 0;}
  347. SHORT FAR PASCAL FcmCleanUp( VOID )
  348. {NotifyNoSuport();return 0;}
  349. BYTE FAR PASCAL MiscConvertFontFamily( LPSTR szFamilyName )
  350. {NotifyNoSuport();return 0;}
  351. BYTE FAR PASCAL MiscConvertCharSet( LPSTR CharSetString )
  352. {NotifyNoSuport();return 0;}
  353. VOID FAR PASCAL MiscIfiMetricsToLogFont(
  354. LPLOGFONT lpLogFont,
  355. LPIFIMETRICS lpIFIMetrics,
  356. USHORT usLogicalMapFlag
  357. )
  358. {NotifyNoSuport();return ;}
  359. VOID FAR PASCAL MiscIfiMetricsToTextMetrics(
  360. LPTEXTMETRIC lpTextMetrics,
  361. LPIFIMETRICS lpIFIMetrics
  362. )
  363. {NotifyNoSuport();return ;}
  364. VOID FAR PASCAL MiscMakeTextXform(
  365. LPVOID lpTXF,
  366. LPIFIMETRICS lpIM,
  367. LPLOGFONT lpLF
  368. )
  369. {NotifyNoSuport();return ;}
  370. LONG FAR PASCAL FcmQueryFaceAttr(
  371. HFB hFB,
  372. ULONG iQuery,
  373. LPABC_TRIPLETS lpBuffer,
  374. ULONG cb,
  375. LPUBCHAR lpIndex,
  376. UBCHAR Start
  377. )
  378. {NotifyNoSuport();return 0;}
  379. SHORT FAR PASCAL FcmProcessDeviceControl(
  380. HFB hFB,
  381. SHORT nFunction,
  382. LPVOID lpGI,
  383. LPVOID lpOutData
  384. )
  385. {NotifyNoSuport();return 0;}
  386. BOOL FAR PASCAL
  387. MiscIsWifeControl( SHORT function )
  388. {NotifyNoSuport();return 0;}
  389. BOOL FAR PASCAL MiscIsGaijiControl( SHORT function )
  390. {NotifyNoSuport();return 0;}
  391. USHORT FAR PASCAL FcmGetCharWidth(
  392. WORD hFB_,
  393. DWORD lpBuffer_,
  394. WORD wFirstChar_,
  395. WORD wLastChar_,
  396. DWORD lpFont_,
  397. DWORD lpDrawMode_,
  398. DWORD lpFontTrans_,
  399. WORD usExpandPixels_,
  400. WORD usMode_
  401. )
  402. {NotifyNoSuport();return 0;}
  403. BOOL FAR PASCAL MiscStretchMonoFontImage(
  404. LPVOID lpDestImage,
  405. USHORT usSizeOfDestX,
  406. USHORT usSizeOfDestY,
  407. LPVOID lpSrcImage,
  408. USHORT usSizeOfSrcX,
  409. USHORT usSizeOfSrcY
  410. )
  411. {NotifyNoSuport();return 0;}
  412. LP_QUICK_SEARCH_TABLE FAR PASCAL MiscValidateQuickSearchTable(
  413. USHORT usLogicalMapFlag
  414. )
  415. {NotifyNoSuport();return 0;}
  416. BOOL FAR PASCAL MiscUnvalidateQuickSearchTable(
  417. USHORT usLogicalMapFlag
  418. )
  419. {NotifyNoSuport();return 0;}
  420. BOOL FAR PASCAL MiscRegisterNotifyFunction(
  421. LPVOID lpfnCallBack
  422. )
  423. {NotifyNoSuport();return 0;}
  424. BOOL FAR PASCAL MiscUnregisterNotifyFunction( LPVOID lpfnCallBack )
  425. {NotifyNoSuport();return 0;}
  426. HFB FAR PASCAL FcmRequestDefaultFBEx( LPVOID lpFont, LPVOID lpTextXform, WORD wControlFlag )
  427. {NotifyNoSuport();return 0;}
  428. VOID FAR PASCAL SetCloseOldestFCFunc(LPVOID lpfnCallbackFunc)
  429. {NotifyNoSuport();return ;}
  430. HFC FAR PASCAL CachedOpenFontContext(
  431. HFD hFD,
  432. HFF hFF,
  433. ULONG ulFont,
  434. LPCONTEXTINFO lpContextInfo,
  435. SHORT sMinorCharSet,
  436. SHORT sAttribute
  437. )
  438. {NotifyNoSuport();return 0;}
  439. SHORT FAR PASCAL FillContextInfo(
  440. unsigned short ftHeight,
  441. unsigned short ftWidth,
  442. LPIFIMETRICS lpIfiMetrics,
  443. HFD hFD,
  444. LPCONTEXTINFO lpContextInfo,
  445. LPCONTEXTINFO lpContextInfoEUDC,
  446. LPVOID lpEUDCContext,
  447. BOOL FAR *lpbSelfMode
  448. )
  449. {NotifyNoSuport();return 0;}
  450. VOID FAR PASCAL GetEUDCFD( HFD FAR *lphFD, HFF FAR *lphFF )
  451. {NotifyNoSuport();return ;}
  452. VOID FAR PASCAL GetDefaultFontInfo( LPVOID lpInfo )
  453. {NotifyNoSuport();return ;}
  454. LPVOID FAR PASCAL DiagLocalLockAnything( LOCALHANDLE hAny )
  455. {NotifyNoSuport();return 0;}
  456. LPVOID FAR PASCAL DiagLocalUnlockAnything( LOCALHANDLE hAny )
  457. {NotifyNoSuport();return 0;}
  458. SHORT FAR PASCAL DiagGetConfirmString( LPSTR buffer, SHORT length )
  459. {NotifyNoSuport();return 0;}
  460. SHORT FAR PASCAL DiagSelfCheck( VOID )
  461. {NotifyNoSuport();return 0;}
  462. SHORT FAR PASCAL DiagSelfCheckAndWarning( VOID )
  463. {NotifyNoSuport();return 0;}
  464. VOID FAR PASCAL DebugAssertion( VOID )
  465. {NotifyNoSuport();return ;}
  466. BOOL FAR PASCAL DelayedInit( VOID )
  467. {NotifyNoSuport();return 0;}
  468. BOOL FAR PASCAL FirstInit( VOID )
  469. {NotifyNoSuport();return 0;}