Source code of Windows XP (NT5)
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.

1124 lines
24 KiB

  1. // Windows CE implementations of W32 Interfaces.
  2. // The following function is needed only because a Windows CE dll must have at least one export
  3. __declspec(dllexport) void Useless( void )
  4. {
  5. return;
  6. }
  7. LONG ValidateTextRange(TEXTRANGE *pstrg);
  8. ATOM WINAPI CW32System::RegisterREClass(
  9. const WNDCLASSW *lpWndClass,
  10. const char *szAnsiClassName,
  11. WNDPROC AnsiWndProc
  12. )
  13. {
  14. // On Windows CE we don't do anything with ANSI window class
  15. return ::RegisterClass(lpWndClass);
  16. }
  17. LRESULT CW32System::ANSIWndProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
  18. {
  19. // Should never be used in WinCE
  20. #pragma message ("Review : Incomplete")
  21. return 0;
  22. }
  23. HGLOBAL WINAPI CW32System::GlobalAlloc( UINT uFlags, DWORD dwBytes )
  24. {
  25. #ifdef TARGET_NT
  26. return ::GlobalAlloc( uFlags, dwBytes);
  27. #else
  28. return LocalAlloc( uFlags & GMEM_ZEROINIT, dwBytes );
  29. #endif
  30. }
  31. HGLOBAL WINAPI CW32System::GlobalFree( HGLOBAL hMem )
  32. {
  33. #ifdef TARGET_NT
  34. return ::GlobalFree( hMem );
  35. #else
  36. return LocalFree( hMem );
  37. #endif
  38. }
  39. UINT WINAPI CW32System::GlobalFlags( HGLOBAL hMem )
  40. {
  41. #ifdef TARGET_NT
  42. return ::GlobalFlags( hMem );
  43. #else
  44. return LocalFlags( hMem );
  45. #endif
  46. }
  47. HGLOBAL WINAPI CW32System::GlobalReAlloc( HGLOBAL hMem, DWORD dwBytes, UINT uFlags )
  48. {
  49. #ifdef TARGET_NT
  50. return ::GlobalReAlloc(hMem, dwBytes, uFlags);
  51. #else
  52. return LocalReAlloc( hMem, dwBytes, uFlags );
  53. #endif
  54. }
  55. DWORD WINAPI CW32System::GlobalSize( HGLOBAL hMem )
  56. {
  57. #ifdef TARGET_NT
  58. return ::GlobalSize( hMem );
  59. #else
  60. return LocalSize( hMem );
  61. #endif
  62. }
  63. LPVOID WINAPI CW32System::GlobalLock( HGLOBAL hMem )
  64. {
  65. #ifdef TARGET_NT
  66. return ::GlobalLock( hMem );
  67. #else
  68. return LocalLock( hMem );
  69. #endif
  70. }
  71. HGLOBAL WINAPI CW32System::GlobalHandle( LPCVOID pMem )
  72. {
  73. #ifdef TARGET_NT
  74. return ::GlobalHandle( pMem );
  75. #else
  76. return LocalHandle( pMem );
  77. #endif
  78. }
  79. BOOL WINAPI CW32System::GlobalUnlock( HGLOBAL hMem )
  80. {
  81. #ifdef TARGET_NT
  82. return ::GlobalUnlock( hMem );
  83. #else
  84. return LocalUnlock( hMem );
  85. #endif
  86. }
  87. BOOL WINAPI CW32System::REGetCharWidth(
  88. HDC hdc,
  89. UINT iChar,
  90. LPINT pAns,
  91. UINT // For Windows CE the code page is not used
  92. // as the A version is not called.
  93. )
  94. {
  95. int i;
  96. SIZE size;
  97. TCHAR buff[2];
  98. buff[0] = iChar;
  99. buff[1] = 0;
  100. if (GetTextExtentExPoint(hdc, buff, 1, 32000, &i, (LPINT)pAns, &size))
  101. {
  102. // pWidthData->width -= xOverhang; // Don't need since we use
  103. // GetTextExtentPoint32()
  104. return TRUE;
  105. }
  106. return FALSE;
  107. }
  108. BOOL WINAPI CW32System::REExtTextOut(
  109. CONVERTMODE cm,
  110. UINT uiCodePage,
  111. HDC hdc,
  112. int x,
  113. int y,
  114. UINT fuOptions,
  115. CONST RECT *lprc,
  116. const WCHAR *lpString,
  117. UINT cbCount,
  118. CONST INT *lpDx,
  119. BOOL FEFontOnNonFEWin95
  120. )
  121. {
  122. #pragma message ("Review : Incomplete")
  123. return ExtTextOut(hdc, x, y, fuOptions, lprc, lpString, cbCount, lpDx);
  124. }
  125. CONVERTMODE WINAPI CW32System::DetermineConvertMode( BYTE tmCharSet )
  126. {
  127. #pragma message ("Review : Incomplete")
  128. return CVT_NONE;
  129. }
  130. void WINAPI CW32System::CalcUnderlineInfo( CCcs *pcccs, TEXTMETRIC *ptm )
  131. {
  132. // Default calculation of size of underline
  133. // Implements a heuristic in the absence of better font information.
  134. SHORT dyDescent = pcccs->_yDescent;
  135. if (0 == dyDescent)
  136. {
  137. dyDescent = pcccs->_yHeight >> 3;
  138. }
  139. pcccs->_dyULWidth = max(1, dyDescent / 4);
  140. pcccs->_dyULOffset = (dyDescent - 3 * pcccs->_dyULWidth + 1) / 2;
  141. if ((0 == pcccs->_dyULOffset) && (dyDescent > 1))
  142. {
  143. pcccs->_dyULOffset = 1;
  144. }
  145. pcccs->_dySOOffset = -ptm->tmAscent / 3;
  146. pcccs->_dySOWidth = pcccs->_dyULWidth;
  147. return;
  148. }
  149. BOOL WINAPI CW32System::ShowScrollBar( HWND hWnd, int wBar, BOOL bShow, LONG nMax )
  150. {
  151. SCROLLINFO si;
  152. Assert(wBar == SB_VERT || wBar == SB_HORZ);
  153. W32->ZeroMemory(&si, sizeof(SCROLLINFO));
  154. si.cbSize = sizeof(SCROLLINFO);
  155. si.fMask = SIF_RANGE | SIF_DISABLENOSCROLL;
  156. if (bShow)
  157. {
  158. si.nMax = nMax;
  159. }
  160. ::SetScrollInfo(hWnd, wBar, &si, TRUE);
  161. return TRUE;
  162. }
  163. BOOL WINAPI CW32System::EnableScrollBar( HWND hWnd, UINT wSBflags, UINT wArrows )
  164. {
  165. BOOL fEnable = TRUE;
  166. BOOL fApi;
  167. SCROLLINFO si;
  168. Assert (wSBflags == SB_VERT || wSBflags == SB_HORZ);
  169. if (wArrows == ESB_DISABLE_BOTH)
  170. {
  171. fEnable = FALSE;
  172. }
  173. // Get the current scroll range
  174. W32->ZeroMemory(&si, sizeof(SCROLLINFO));
  175. si.cbSize = sizeof(SCROLLINFO);
  176. si.fMask = SIF_RANGE;
  177. fApi = ::GetScrollInfo(hWnd, wSBflags, &si);
  178. if (fApi && !fEnable)
  179. {
  180. si.fMask = SIF_RANGE | SIF_DISABLENOSCROLL;
  181. si.nMin = 0;
  182. si.nMax = 0;
  183. }
  184. if (fApi) ::SetScrollInfo(hWnd, wSBflags, &si, TRUE);
  185. return fApi ? TRUE : FALSE;
  186. }
  187. BOOL WINAPI CW32System::IsEnhancedMetafileDC( HDC )
  188. {
  189. // No enhanced metafile
  190. return FALSE;
  191. }
  192. UINT WINAPI CW32System::GetTextAlign(HDC hdc)
  193. {
  194. // Review :: SHould we set last error?
  195. return GDI_ERROR;
  196. }
  197. UINT WINAPI CW32System::SetTextAlign(HDC hdc, UINT uAlign)
  198. {
  199. // Review :: SHould we set last error?
  200. return GDI_ERROR;
  201. }
  202. UINT WINAPI CW32System::InvertRect(HDC hdc, CONST RECT *prc)
  203. {
  204. HBITMAP hbm, hbmOld;
  205. HDC hdcMem;
  206. int nHeight, nWidth;
  207. nWidth = prc->right-prc->left;
  208. nHeight = prc->bottom-prc->top;
  209. hdcMem = CreateCompatibleDC(hdc);
  210. hbm = CreateCompatibleBitmap(hdc, nWidth, nHeight);
  211. hbmOld = (HBITMAP) SelectObject(hdcMem, hbm);
  212. BitBlt(hdcMem, 0, 0, nWidth, nHeight, hdc, prc->left, prc->top,
  213. SRCCOPY);
  214. FillRect(hdc, prc, (HBRUSH)GetStockObject(WHITE_BRUSH));
  215. BitBlt(hdc, prc->left, prc->top, nWidth,
  216. nHeight, hdcMem, 0, 0, SRCINVERT);
  217. SelectObject(hdcMem, hbmOld);
  218. DeleteDC(hdcMem);
  219. DeleteObject(hbm);
  220. return TRUE;
  221. }
  222. HPALETTE WINAPI CW32System::ManagePalette(
  223. HDC,
  224. CONST LOGPALETTE *,
  225. HPALETTE &,
  226. HPALETTE &
  227. )
  228. {
  229. // No op for Windows CE
  230. return NULL;
  231. }
  232. int WINAPI CW32System::GetMapMode(HDC)
  233. {
  234. // Only MM Text supported on Win CE
  235. return MM_TEXT;
  236. }
  237. BOOL WINAPI CW32System::WinLPtoDP(HDC, LPPOINT, int)
  238. {
  239. // This is not available on Win CE
  240. return 0;
  241. }
  242. long WINAPI CW32System::WvsprintfA( LONG cbBuf, LPSTR pszBuf, LPCSTR pszFmt, va_list arglist )
  243. {
  244. WCHAR wszBuf[64];
  245. WCHAR wszFmt[64];
  246. WCHAR *pwszBuf = wszBuf;
  247. WCHAR *pwszFmt = wszFmt;
  248. Assert(cbBuf < 64);
  249. while (*pszFmt)
  250. {
  251. *pwszFmt++ = *pszFmt++;
  252. if (*(pwszFmt - 1) == '%')
  253. {
  254. Assert(*pszFmt == 's' || *pszFmt == 'd' || *pszFmt == '0' || *pszFmt == 'c');
  255. if (*pszFmt == 's')
  256. {
  257. *pwszFmt++ = 'h';
  258. }
  259. }
  260. }
  261. *pwszFmt = 0;
  262. LONG cw = wvsprintf( wszBuf, wszFmt, arglist );
  263. while (*pszBuf++ = *pwszBuf++);
  264. Assert(cw < cbBuf);
  265. return cw;
  266. }
  267. int WINAPI CW32System::MulDiv(int nNumber, int nNumerator, int nDenominator)
  268. {
  269. // Special handling for Win CE
  270. // Must be careful to not cause divide by zero
  271. // Note that overflow on the multiplication is not handled
  272. // Hopefully that is not a problem for RichEdit use
  273. // Added Guy's fix up for rounding.
  274. // Conservative check to see if multiplication will overflow.
  275. if (IN_RANGE(_I16_MIN, nNumber, _I16_MAX) &&
  276. IN_RANGE(_I16_MIN, nNumerator, _I16_MAX))
  277. {
  278. return nDenominator ? ((nNumber * nNumerator) + (nDenominator / 2)) / nDenominator : -1;
  279. }
  280. __int64 NNumber = nNumber;
  281. __int64 NNumerator = nNumerator;
  282. __int64 NDenominator = nDenominator;
  283. return NDenominator ? ((NNumber * NNumerator) + (NDenominator / 2)) / NDenominator : -1;
  284. }
  285. void CW32System::GetFacePriCharSet(HDC hdc, LOGFONT* plf)
  286. {
  287. plf->lfCharSet = 0;
  288. }
  289. void CW32System::CheckChangeKeyboardLayout ( CTxtSelection *psel, BOOL fChangedFont )
  290. {
  291. #pragma message ("Review : Incomplete")
  292. return;
  293. }
  294. void CW32System::CheckChangeFont (
  295. CTxtSelection *psel,
  296. CTxtEdit * const ped,
  297. BOOL fEnableReassign, // @parm Do we enable CTRL key?
  298. const WORD lcID, // @parm LCID from WM_ message
  299. UINT cpg // @parm code page to use (could be ANSI for far east with IME off)
  300. )
  301. {
  302. #pragma message ("Review : Incomplete")
  303. return;
  304. }
  305. HKL CW32System::GetKeyboardLayout ( DWORD )
  306. {
  307. #pragma message ("Review : Incomplete")
  308. return NULL;
  309. }
  310. HRESULT CW32System::LoadRegTypeLib ( REFGUID, WORD, WORD, LCID, ITypeLib ** )
  311. {
  312. return E_NOTIMPL;
  313. }
  314. HRESULT CW32System::LoadTypeLib ( const OLECHAR *, ITypeLib ** )
  315. {
  316. return E_NOTIMPL;
  317. }
  318. BSTR CW32System::SysAllocString ( const OLECHAR * )
  319. {
  320. #pragma message ("Review : Incomplete")
  321. return NULL;
  322. }
  323. BSTR CW32System::SysAllocStringLen ( const OLECHAR *, UINT )
  324. {
  325. #pragma message ("Review : Incomplete")
  326. return NULL;
  327. }
  328. void CW32System::SysFreeString ( BSTR )
  329. {
  330. #pragma message ("Review : Incomplete")
  331. return;
  332. }
  333. UINT CW32System::SysStringLen ( BSTR )
  334. {
  335. #pragma message ("Review : Incomplete")
  336. return 0;
  337. }
  338. void CW32System::VariantInit ( VARIANTARG * )
  339. {
  340. #pragma message ("Review : Incomplete")
  341. return;
  342. }
  343. HRESULT CW32System::OleCreateFromData ( LPDATAOBJECT, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, void ** )
  344. {
  345. #pragma message ("Review : Incomplete")
  346. return 0;
  347. }
  348. void CW32System::CoTaskMemFree ( LPVOID )
  349. {
  350. #pragma message ("Review : Incomplete")
  351. return;
  352. }
  353. HRESULT CW32System::CreateBindCtx ( DWORD, LPBC * )
  354. {
  355. #pragma message ("Review : Incomplete")
  356. return 0;
  357. }
  358. HANDLE CW32System::OleDuplicateData ( HANDLE, CLIPFORMAT, UINT )
  359. {
  360. #pragma message ("Review : Incomplete")
  361. return NULL;
  362. }
  363. HRESULT CW32System::CoTreatAsClass ( REFCLSID, REFCLSID )
  364. {
  365. #pragma message ("Review : Incomplete")
  366. return 0;
  367. }
  368. HRESULT CW32System::ProgIDFromCLSID ( REFCLSID, LPOLESTR * )
  369. {
  370. #pragma message ("Review : Incomplete")
  371. return 0;
  372. }
  373. HRESULT CW32System::OleConvertIStorageToOLESTREAM ( LPSTORAGE, LPOLESTREAM )
  374. {
  375. #pragma message ("Review : Incomplete")
  376. return 0;
  377. }
  378. HRESULT CW32System::OleConvertIStorageToOLESTREAMEx ( LPSTORAGE, CLIPFORMAT, LONG, LONG, DWORD, LPSTGMEDIUM, LPOLESTREAM )
  379. {
  380. #pragma message ("Review : Incomplete")
  381. return 0;
  382. }
  383. HRESULT CW32System::OleSave ( LPPERSISTSTORAGE, LPSTORAGE, BOOL )
  384. {
  385. #pragma message ("Review : Incomplete")
  386. return 0;
  387. }
  388. HRESULT CW32System::StgCreateDocfileOnILockBytes ( ILockBytes *, DWORD, DWORD, IStorage ** )
  389. {
  390. #pragma message ("Review : Incomplete")
  391. return 0;
  392. }
  393. HRESULT CW32System::CreateILockBytesOnHGlobal ( HGLOBAL, BOOL, ILockBytes ** )
  394. {
  395. #pragma message ("Review : Incomplete")
  396. return 0;
  397. }
  398. HRESULT CW32System::OleCreateLinkToFile ( LPCOLESTR, REFIID, DWORD, LPFORMATETC, LPOLECLIENTSITE, LPSTORAGE, void ** )
  399. {
  400. #pragma message ("Review : Incomplete")
  401. return 0;
  402. }
  403. LPVOID CW32System::CoTaskMemAlloc ( ULONG )
  404. {
  405. #pragma message ("Review : Incomplete")
  406. return NULL;
  407. }
  408. LPVOID CW32System::CoTaskMemRealloc ( LPVOID, ULONG )
  409. {
  410. #pragma message ("Review : Incomplete")
  411. return NULL;
  412. }
  413. HRESULT CW32System::OleInitialize ( LPVOID )
  414. {
  415. #pragma message ("Review : Incomplete")
  416. return 0;
  417. }
  418. void CW32System::OleUninitialize ( )
  419. {
  420. #pragma message ("Review : Incomplete")
  421. return;
  422. }
  423. HRESULT CW32System::OleSetClipboard ( IDataObject * )
  424. {
  425. return E_NOTIMPL;
  426. }
  427. HRESULT CW32System::OleFlushClipboard ( )
  428. {
  429. #pragma message ("Review : Incomplete")
  430. return 0;
  431. }
  432. HRESULT CW32System::OleIsCurrentClipboard ( IDataObject * )
  433. {
  434. #pragma message ("Review : Incomplete")
  435. return 0;
  436. }
  437. HRESULT CW32System::DoDragDrop ( IDataObject *, IDropSource *, DWORD, DWORD * )
  438. {
  439. #pragma message ("Review : Incomplete")
  440. return 0;
  441. }
  442. HRESULT CW32System::OleGetClipboard ( IDataObject ** )
  443. {
  444. return E_NOTIMPL;
  445. }
  446. HRESULT CW32System::RegisterDragDrop ( HWND, IDropTarget * )
  447. {
  448. #pragma message ("Review : Incomplete")
  449. return 0;
  450. }
  451. HRESULT CW32System::OleCreateLinkFromData ( IDataObject *, REFIID, DWORD, LPFORMATETC, IOleClientSite *, IStorage *, void ** )
  452. {
  453. #pragma message ("Review : Incomplete")
  454. return 0;
  455. }
  456. HRESULT CW32System::OleCreateStaticFromData ( IDataObject *, REFIID, DWORD, LPFORMATETC, IOleClientSite *, IStorage *, void ** )
  457. {
  458. #pragma message ("Review : Incomplete")
  459. return 0;
  460. }
  461. HRESULT CW32System::OleDraw ( IUnknown *, DWORD, HDC, LPCRECT )
  462. {
  463. #pragma message ("Review : Incomplete")
  464. return 0;
  465. }
  466. HRESULT CW32System::OleSetContainedObject ( IUnknown *, BOOL )
  467. {
  468. #pragma message ("Review : Incomplete")
  469. return 0;
  470. }
  471. HRESULT CW32System::CoDisconnectObject ( IUnknown *, DWORD )
  472. {
  473. #pragma message ("Review : Incomplete")
  474. return 0;
  475. }
  476. HRESULT CW32System::WriteFmtUserTypeStg ( IStorage *, CLIPFORMAT, LPOLESTR )
  477. {
  478. #pragma message ("Review : Incomplete")
  479. return 0;
  480. }
  481. HRESULT CW32System::WriteClassStg ( IStorage *, REFCLSID )
  482. {
  483. #pragma message ("Review : Incomplete")
  484. return 0;
  485. }
  486. HRESULT CW32System::SetConvertStg ( IStorage *, BOOL )
  487. {
  488. #pragma message ("Review : Incomplete")
  489. return 0;
  490. }
  491. HRESULT CW32System::ReadFmtUserTypeStg ( IStorage *, CLIPFORMAT *, LPOLESTR * )
  492. {
  493. #pragma message ("Review : Incomplete")
  494. return 0;
  495. }
  496. HRESULT CW32System::ReadClassStg ( IStorage *pstg, CLSID * )
  497. {
  498. #pragma message ("Review : Incomplete")
  499. return 0;
  500. }
  501. HRESULT CW32System::OleRun ( IUnknown * )
  502. {
  503. #pragma message ("Review : Incomplete")
  504. return 0;
  505. }
  506. HRESULT CW32System::RevokeDragDrop ( HWND )
  507. {
  508. #pragma message ("Review : Incomplete")
  509. return 0;
  510. }
  511. HRESULT CW32System::CreateStreamOnHGlobal ( HGLOBAL, BOOL, IStream ** )
  512. {
  513. #pragma message ("Review : Incomplete")
  514. return 0;
  515. }
  516. HRESULT CW32System::GetHGlobalFromStream ( IStream *pstm, HGLOBAL * )
  517. {
  518. #pragma message ("Review : Incomplete")
  519. return 0;
  520. }
  521. HRESULT CW32System::OleCreateDefaultHandler ( REFCLSID, IUnknown *, REFIID, void ** )
  522. {
  523. #pragma message ("Review : Incomplete")
  524. return 0;
  525. }
  526. HRESULT CW32System::CLSIDFromProgID ( LPCOLESTR, LPCLSID )
  527. {
  528. #pragma message ("Review : Incomplete")
  529. return 0;
  530. }
  531. HRESULT CW32System::OleConvertOLESTREAMToIStorage ( LPOLESTREAM, IStorage *, const DVTARGETDEVICE * )
  532. {
  533. #pragma message ("Review : Incomplete")
  534. return 0;
  535. }
  536. HRESULT CW32System::OleLoad ( IStorage *, REFIID, IOleClientSite *, void ** )
  537. {
  538. #pragma message ("Review : Incomplete")
  539. return 0;
  540. }
  541. HRESULT CW32System::ReleaseStgMedium ( LPSTGMEDIUM pstgmed)
  542. {
  543. #pragma message ("Review : Incomplete")
  544. // we don't use anything other than TYMED_HGLOBAL currently.
  545. if (pstgmed && (pstgmed->tymed == TYMED_HGLOBAL)) {
  546. ::LocalFree(pstgmed->hGlobal);
  547. }
  548. return 0;
  549. }
  550. HRESULT CW32System::CoCreateInstance (REFCLSID rclsid, LPUNKNOWN pUnknown,
  551. DWORD dwClsContext, REFIID riid, LPVOID *ppv)
  552. {
  553. #pragma message ("Review : Incomplete")
  554. return S_FALSE;
  555. }
  556. void CW32System::FreeOle()
  557. {
  558. #pragma message ("Review : Incomplete")
  559. }
  560. void CW32System::FreeIME()
  561. {
  562. #pragma message ("Review : Incomplete")
  563. }
  564. BOOL CW32System::HaveAIMM()
  565. {
  566. #pragma message ("Review : Incomplete")
  567. return FALSE;
  568. }
  569. BOOL CW32System::HaveIMEShare()
  570. {
  571. #pragma message ("Review : Incomplete")
  572. return FALSE;
  573. }
  574. BOOL CW32System::getIMEShareObject(CIMEShare **ppIMEShare)
  575. {
  576. #pragma message ("Review : Incomplete")
  577. return FALSE;
  578. }
  579. LRESULT CW32System::AIMMDefWndProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *plres)
  580. {
  581. #pragma message ("Review : Incomplete")
  582. return S_FALSE;
  583. }
  584. LRESULT CW32System::AIMMGetCodePage(HKL hKL, UINT *uCodePage)
  585. {
  586. #pragma message ("Review : Incomplete")
  587. return S_FALSE;
  588. }
  589. LRESULT CW32System::AIMMActivate(BOOL fRestoreLayout)
  590. {
  591. #pragma message ("Review : Incomplete")
  592. return S_FALSE;
  593. }
  594. LRESULT CW32System::AIMMDeactivate(void)
  595. {
  596. #pragma message ("Review : Incomplete")
  597. return S_FALSE;
  598. }
  599. LRESULT CW32System::AIMMFilterClientWindows(ATOM *aaClassList, UINT uSize)
  600. {
  601. #pragma message ("Review : Incomplete")
  602. return S_FALSE;
  603. }
  604. BOOL CW32System::ImmInitialize( void )
  605. {
  606. #pragma message ("Review : Incomplete")
  607. return FALSE;
  608. }
  609. void CW32System::ImmTerminate( void )
  610. {
  611. #pragma message ("Review : Incomplete")
  612. return;
  613. }
  614. LONG CW32System::ImmGetCompositionStringA ( HIMC, DWORD, LPVOID, DWORD )
  615. {
  616. #pragma message ("Review : Incomplete")
  617. return 0;
  618. }
  619. HIMC CW32System::ImmGetContext ( HWND )
  620. {
  621. #pragma message ("Review : Incomplete")
  622. return 0;
  623. }
  624. BOOL CW32System::ImmSetCompositionFontA ( HIMC, LPLOGFONTA )
  625. {
  626. #pragma message ("Review : Incomplete")
  627. return FALSE;
  628. }
  629. BOOL CW32System::ImmSetCompositionWindow ( HIMC, LPCOMPOSITIONFORM )
  630. {
  631. #pragma message ("Review : Incomplete")
  632. return FALSE;
  633. }
  634. BOOL CW32System::ImmReleaseContext ( HWND, HIMC )
  635. {
  636. #pragma message ("Review : Incomplete")
  637. return FALSE;
  638. }
  639. DWORD CW32System::ImmGetProperty ( HKL, DWORD )
  640. {
  641. #pragma message ("Review : Incomplete")
  642. return 0;
  643. }
  644. BOOL CW32System::ImmGetCandidateWindow ( HIMC, DWORD, LPCANDIDATEFORM )
  645. {
  646. #pragma message ("Review : Incomplete")
  647. return FALSE;
  648. }
  649. BOOL CW32System::ImmSetCandidateWindow ( HIMC, LPCANDIDATEFORM )
  650. {
  651. #pragma message ("Review : Incomplete")
  652. return FALSE;
  653. }
  654. BOOL CW32System::ImmNotifyIME ( HIMC, DWORD, DWORD, DWORD )
  655. {
  656. #pragma message ("Review : Incomplete")
  657. return FALSE;
  658. }
  659. HIMC CW32System::ImmAssociateContext ( HWND, HIMC )
  660. {
  661. #pragma message ("Review : Incomplete")
  662. return NULL;
  663. }
  664. UINT CW32System::ImmGetVirtualKey ( HWND )
  665. {
  666. #pragma message ("Review : Incomplete")
  667. return 0;
  668. }
  669. HIMC CW32System::ImmEscape ( HKL, HIMC, UINT, LPVOID )
  670. {
  671. #pragma message ("Review : Incomplete")
  672. return NULL;
  673. }
  674. LONG CW32System::ImmGetOpenStatus ( HIMC )
  675. {
  676. #pragma message ("Review : Incomplete")
  677. return 0;
  678. }
  679. BOOL CW32System::ImmGetConversionStatus ( HIMC, LPDWORD, LPDWORD )
  680. {
  681. #pragma message ("Review : Incomplete")
  682. return FALSE;
  683. }
  684. HWND CW32System::ImmGetDefaultIMEWnd ( HWND )
  685. {
  686. #pragma message ("Review : Incomplete")
  687. return NULL;
  688. }
  689. BOOL CW32System::FSupportSty ( UINT, UINT )
  690. {
  691. #pragma message ("Review : Incomplete")
  692. return FALSE;
  693. }
  694. const IMESTYLE * CW32System::PIMEStyleFromAttr ( const UINT )
  695. {
  696. #pragma message ("Review : Incomplete")
  697. return NULL;
  698. }
  699. const IMECOLORSTY * CW32System::PColorStyleTextFromIMEStyle ( const IMESTYLE * )
  700. {
  701. #pragma message ("Review : Incomplete")
  702. return NULL;
  703. }
  704. const IMECOLORSTY * CW32System::PColorStyleBackFromIMEStyle ( const IMESTYLE * )
  705. {
  706. #pragma message ("Review : Incomplete")
  707. return NULL;
  708. }
  709. BOOL CW32System::FBoldIMEStyle ( const IMESTYLE * )
  710. {
  711. #pragma message ("Review : Incomplete")
  712. return FALSE;
  713. }
  714. BOOL CW32System::FItalicIMEStyle ( const IMESTYLE * )
  715. {
  716. #pragma message ("Review : Incomplete")
  717. return FALSE;
  718. }
  719. BOOL CW32System::FUlIMEStyle ( const IMESTYLE * )
  720. {
  721. #pragma message ("Review : Incomplete")
  722. return FALSE;
  723. }
  724. UINT CW32System::IdUlIMEStyle ( const IMESTYLE * )
  725. {
  726. #pragma message ("Review : Incomplete")
  727. return 0;
  728. }
  729. COLORREF CW32System::RGBFromIMEColorStyle ( const IMECOLORSTY * )
  730. {
  731. #pragma message ("Review : Incomplete")
  732. return 0;
  733. }
  734. BOOL CW32System::GetVersion(
  735. DWORD *pdwPlatformId,
  736. DWORD *pdwMajorVersion
  737. )
  738. {
  739. OSVERSIONINFO osv;
  740. osv.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  741. *pdwPlatformId = 0;
  742. *pdwMajorVersion = 0;
  743. if (GetVersionEx(&osv))
  744. {
  745. *pdwPlatformId = osv.dwPlatformId;
  746. *pdwMajorVersion = osv.dwMajorVersion;
  747. return TRUE;
  748. }
  749. return FALSE;
  750. }
  751. BOOL WINAPI CW32System::GetStringTypeEx(
  752. LCID lcid,
  753. DWORD dwInfoType,
  754. LPCTSTR lpSrcStr,
  755. int cchSrc,
  756. LPWORD lpCharType
  757. )
  758. {
  759. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "GetStringTypeEx");
  760. return ::GetStringTypeExW(lcid, dwInfoType, lpSrcStr, cchSrc, lpCharType);
  761. }
  762. LPWSTR WINAPI CW32System::CharLower(LPWSTR pwstr)
  763. {
  764. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "CharLowerWrap");
  765. return ::CharLowerW(pwstr);
  766. }
  767. DWORD WINAPI CW32System::CharLowerBuff(LPWSTR pwstr, DWORD cchLength)
  768. {
  769. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "CharLowerBuffWrap");
  770. return ::CharLowerBuffW(pwstr, cchLength);
  771. }
  772. DWORD WINAPI CW32System::CharUpperBuff(LPWSTR pwstr, DWORD cchLength)
  773. {
  774. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "CharUpperBuffWrap");
  775. return ::CharUpperBuffW(pwstr, cchLength);
  776. }
  777. HDC WINAPI CW32System::CreateIC(
  778. LPCWSTR lpszDriver,
  779. LPCWSTR lpszDevice,
  780. LPCWSTR lpszOutput,
  781. CONST DEVMODEW * lpInitData)
  782. {
  783. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "CreateIC");
  784. return ::CreateDCW( lpszDriver, lpszDevice, lpszOutput, lpInitData);
  785. }
  786. HANDLE WINAPI CW32System::CreateFile(
  787. LPCWSTR lpFileName,
  788. DWORD dwDesiredAccess,
  789. DWORD dwShareMode,
  790. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  791. DWORD dwCreationDisposition,
  792. DWORD dwFlagsAndAttributes,
  793. HANDLE hTemplateFile
  794. )
  795. {
  796. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "CreateFile");
  797. return ::CreateFileW(lpFileName,
  798. dwDesiredAccess,
  799. dwShareMode,
  800. lpSecurityAttributes,
  801. dwCreationDisposition,
  802. dwFlagsAndAttributes,
  803. hTemplateFile);
  804. }
  805. HFONT WINAPI CW32System::CreateFontIndirect(CONST LOGFONTW * plfw)
  806. {
  807. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "CreateFontIndirect");
  808. return ::CreateFontIndirectW(plfw);
  809. }
  810. int WINAPI CW32System::CompareString (
  811. LCID Locale, // locale identifier
  812. DWORD dwCmpFlags, // comparison-style options
  813. LPCWSTR lpString1, // pointer to first string
  814. int cchCount1, // size, in bytes or characters, of first string
  815. LPCWSTR lpString2, // pointer to second string
  816. int cchCount2 // size, in bytes or characters, of second string
  817. )
  818. {
  819. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "CompareString");
  820. return ::CompareStringW(Locale, dwCmpFlags, lpString1, cchCount1, lpString2, cchCount2);
  821. }
  822. LRESULT WINAPI CW32System::DefWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
  823. {
  824. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "DefWindowProc");
  825. return ::DefWindowProcW(hWnd, msg, wParam, lParam);
  826. }
  827. int WINAPI CW32System::GetObject(HGDIOBJ hgdiObj, int cbBuffer, LPVOID lpvObj)
  828. {
  829. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "GetObject");
  830. return ::GetObjectW( hgdiObj, cbBuffer, lpvObj );
  831. }
  832. DWORD APIENTRY CW32System::GetProfileSection(
  833. LPCWSTR ,
  834. LPWSTR ,
  835. DWORD
  836. )
  837. {
  838. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "GetProfileSection");
  839. // Not available on Win CE
  840. return 0;
  841. }
  842. int WINAPI CW32System::GetTextFace(
  843. HDC hdc,
  844. int cch,
  845. LPWSTR lpFaceName
  846. )
  847. {
  848. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "GetTextFaceWrap");
  849. return ::GetTextFaceW( hdc, cch, lpFaceName );
  850. }
  851. BOOL WINAPI CW32System::GetTextMetrics(HDC hdc, LPTEXTMETRICW lptm)
  852. {
  853. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "GetTextMetrics");
  854. return ::GetTextMetricsW( hdc, lptm);
  855. }
  856. LONG WINAPI CW32System::GetWindowLong(HWND hWnd, int nIndex)
  857. {
  858. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "GetWindowLong");
  859. return ::GetWindowLongW(hWnd, nIndex);
  860. }
  861. DWORD WINAPI CW32System::GetClassLong(HWND hWnd, int nIndex)
  862. {
  863. #pragma message ("Review : Incomplete")
  864. return 0;
  865. }
  866. HBITMAP WINAPI CW32System::LoadBitmap(HINSTANCE hInstance, LPCWSTR lpBitmapName)
  867. {
  868. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "LoadBitmap");
  869. Assert(HIWORD(lpBitmapName) == 0);
  870. return ::LoadBitmapW(hInstance, lpBitmapName);
  871. }
  872. HCURSOR WINAPI CW32System::LoadCursor(HINSTANCE hInstance, LPCWSTR lpCursorName)
  873. {
  874. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "LoadCursor");
  875. Assert(HIWORD(lpCursorName) == 0);
  876. return (HCURSOR)lpCursorName;
  877. }
  878. HINSTANCE WINAPI CW32System::LoadLibrary(LPCWSTR lpLibFileName)
  879. {
  880. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "LoadLibrary");
  881. return ::LoadLibraryW(lpLibFileName);
  882. }
  883. LRESULT WINAPI CW32System::SendMessage(
  884. HWND hWnd,
  885. UINT Msg,
  886. WPARAM wParam,
  887. LPARAM lParam
  888. )
  889. {
  890. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "SendMessage");
  891. return ::SendMessageW(hWnd, Msg, wParam, lParam);
  892. }
  893. LONG WINAPI CW32System::SetWindowLong(HWND hWnd, int nIndex, LONG dwNewLong)
  894. {
  895. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "SetWindowLongWrap");
  896. return ::SetWindowLongW(hWnd, nIndex, dwNewLong);
  897. }
  898. BOOL WINAPI CW32System::PostMessage(
  899. HWND hWnd,
  900. UINT Msg,
  901. WPARAM wParam,
  902. LPARAM lParam
  903. )
  904. {
  905. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "PostMessage");
  906. return ::PostMessageW(hWnd, Msg, wParam, lParam);
  907. }
  908. BOOL WINAPI CW32System::UnregisterClass(LPCWSTR lpClassName, HINSTANCE hInstance)
  909. {
  910. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "UnregisterClass");
  911. return ::UnregisterClassW( lpClassName, hInstance);
  912. }
  913. int WINAPI CW32System::lstrcmp(LPCWSTR lpString1, LPCWSTR lpString2)
  914. {
  915. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "lstrcmp");
  916. return ::lstrcmpW(lpString1, lpString2);
  917. }
  918. int WINAPI CW32System::lstrcmpi(LPCWSTR lpString1, LPCWSTR lpString2)
  919. {
  920. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "lstrcmpi");
  921. return ::lstrcmpiW(lpString1, lpString2);
  922. }
  923. BOOL WINAPI CW32System::PeekMessage(
  924. LPMSG lpMsg,
  925. HWND hWnd,
  926. UINT wMsgFilterMin,
  927. UINT wMsgFilterMax,
  928. UINT wRemoveMsg
  929. )
  930. {
  931. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "PeekMessage");
  932. return ::PeekMessageW(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
  933. }
  934. DWORD WINAPI CW32System::GetModuleFileName(
  935. HMODULE hModule,
  936. LPWSTR lpFilename,
  937. DWORD nSize
  938. )
  939. {
  940. TRACEBEGIN(TRCSUBSYSWRAP, TRCSCOPEINTERN, "GetModuleFileName");
  941. // On Windows CE we will always be known as riched20.dll
  942. CopyMemory(lpFilename, TEXT("riched20.dll"), sizeof(TEXT("riched20.dll")));
  943. return sizeof(TEXT("riched20.dll"))/sizeof(WCHAR) - 1;
  944. }
  945. BOOL WINAPI CW32System::GetCursorPos(
  946. POINT *ppt
  947. )
  948. {
  949. DWORD dw;
  950. dw = GetMessagePos();
  951. ppt->x = LOWORD(dw);
  952. ppt->y = HIWORD(dw);
  953. return TRUE;
  954. }
  955. #pragma message("JMO : Need to add Win CE version of InitSysParam!")