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.

1248 lines
25 KiB

  1. //============================================================================
  2. //
  3. // Stub or little implementation for Win32 specific APIs
  4. //
  5. //============================================================================
  6. #include "pch.hxx"
  7. #include <direct.h>
  8. #include <shlwapi.h>
  9. #include <shellapi.h>
  10. #include "list.h"
  11. #define EACCES 13
  12. extern "C"
  13. {
  14. /*****************************************************************************\
  15. * *
  16. * From winbase.h (INC32)
  17. * *
  18. \*****************************************************************************/
  19. BOOL
  20. WINAPI __export
  21. SetFileAttributesA(
  22. LPCSTR lpFileName,
  23. DWORD dwFileAttributes
  24. )
  25. {
  26. return( FALSE );
  27. }
  28. BOOL
  29. WINAPI __export
  30. SetFileAttributesW(
  31. LPCWSTR lpFileName,
  32. DWORD dwFileAttributes
  33. )
  34. {
  35. return( FALSE );
  36. }
  37. /* HeapAlloc and HeapFree uses Global memory
  38. */
  39. CList * g_HeapList = NULL;
  40. LPVOID
  41. WINAPI __export
  42. OE16HeapAlloc(
  43. HANDLE hHeap,
  44. DWORD dwFlags,
  45. DWORD dwBytes
  46. )
  47. {
  48. Assert ( dwBytes < 0x10000 ); // Can't handle more than 64KB
  49. return malloc( dwBytes );
  50. }
  51. LPVOID
  52. WINAPI __export
  53. HeapReAlloc(
  54. HANDLE hHeap,
  55. DWORD dwFlags,
  56. LPVOID lpMem,
  57. DWORD dwBytes
  58. )
  59. {
  60. return( NULL );
  61. }
  62. BOOL
  63. WINAPI __export
  64. OE16HeapFree(
  65. HANDLE hHeap,
  66. DWORD dwFlags,
  67. LPVOID lpMem
  68. )
  69. {
  70. free (lpMem );
  71. return TRUE;
  72. }
  73. DWORD
  74. WINAPI __export
  75. HeapSize(
  76. HANDLE hHeap,
  77. DWORD dwFlags,
  78. LPCVOID lpMem
  79. )
  80. {
  81. return 0;
  82. }
  83. DWORD
  84. WINAPI __export
  85. GetShortPathNameA(
  86. LPCSTR lpszLongPath,
  87. LPSTR lpszShortPath,
  88. DWORD cchBuffer
  89. )
  90. {
  91. return( 0L );
  92. }
  93. VOID
  94. WINAPI __export
  95. SetLastError(
  96. DWORD dwErrCode
  97. )
  98. {
  99. }
  100. #ifdef RUN16_WIN16X
  101. LONG
  102. WINAPI
  103. CompareFileTime(
  104. CONST FILETIME *lpFileTime1,
  105. CONST FILETIME *lpFileTime2
  106. )
  107. {
  108. return( 0 );
  109. }
  110. #endif
  111. /***** It is in Win16x.h as dummy inline
  112. VOID
  113. WINAPI
  114. Sleep(
  115. DWORD dwMilliseconds
  116. )
  117. {
  118. sleep( (unsigned)((dwMilliseconds+999)/1000) );
  119. Yield();
  120. }
  121. ********/
  122. BOOL
  123. WINAPI __export
  124. CreateProcessA(
  125. LPCSTR lpApplicationName,
  126. LPSTR lpCommandLine,
  127. LPSECURITY_ATTRIBUTES lpProcessAttributes,
  128. LPSECURITY_ATTRIBUTES lpThreadAttributes,
  129. BOOL bInheritHandles,
  130. DWORD dwCreationFlags,
  131. LPVOID lpEnvironment,
  132. LPCSTR lpCurrentDirectory,
  133. LPSTARTUPINFOA lpStartupInfo,
  134. LPPROCESS_INFORMATION lpProcessInformation
  135. )
  136. {
  137. return( FALSE );
  138. }
  139. UINT
  140. WINAPI __export
  141. GetDriveTypeA(
  142. LPCSTR lpRootPathName
  143. )
  144. {
  145. return( 0 ); // DRIVE_UNKNOWN
  146. }
  147. DWORD
  148. WINAPI __export
  149. GetEnvironmentVariableA(
  150. LPCSTR lpName,
  151. LPSTR lpBuffer,
  152. DWORD nSize
  153. )
  154. {
  155. return( 0 );
  156. }
  157. BOOL
  158. WINAPI __export
  159. CreateDirectoryA(
  160. LPCSTR lpPathName,
  161. LPSECURITY_ATTRIBUTES lpSecurityAttributes
  162. )
  163. {
  164. if ( !mkdir( lpPathName ) )
  165. if ( errno != EACCES )
  166. return FALSE;
  167. return TRUE;
  168. }
  169. BOOL
  170. WINAPI __export
  171. GetUserNameA (
  172. LPSTR lpBuffer,
  173. LPDWORD nSize
  174. )
  175. {
  176. return( FALSE );
  177. }
  178. BOOL
  179. WINAPI __export
  180. GetComputerNameA (
  181. LPSTR lpBuffer,
  182. LPDWORD nSize
  183. )
  184. {
  185. return( FALSE );
  186. }
  187. /*****************************************************************************\
  188. * *
  189. * OE16 File mapping object related function
  190. * *
  191. \*****************************************************************************/
  192. CList * g_FileMappingList = NULL;
  193. LPVOID
  194. WINAPI __export
  195. OE16CreateFileMapping(
  196. HANDLE hFile,
  197. LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
  198. DWORD flProtect,
  199. DWORD dwMaximumSizeHigh,
  200. DWORD dwMaximumSizeLow,
  201. LPCSTR lpName
  202. )
  203. {
  204. LPVOID lpMem;
  205. LPCSTR lpNameLocal;
  206. if ( !g_FileMappingList )
  207. g_FileMappingList = new CList;
  208. if ( !g_FileMappingList )
  209. return (LPVOID)NULL;
  210. lpMem = g_FileMappingList->FindItemHandleWithName ( lpName, NULL );
  211. if ( lpMem == NULL )
  212. {
  213. lpMem = malloc( dwMaximumSizeLow );
  214. if ( lpMem != NULL )
  215. {
  216. ZeroMemory ( lpMem, dwMaximumSizeLow );
  217. lpNameLocal = strdup( lpName );
  218. if( lpNameLocal )
  219. g_FileMappingList->AddItemWithName( (LPVOID)lpMem, lpNameLocal );
  220. else
  221. {
  222. free( lpMem );
  223. lpMem = NULL;
  224. }
  225. }
  226. }
  227. return lpMem;
  228. }
  229. LPVOID
  230. WINAPI __export
  231. OE16MapViewOfFile(
  232. HANDLE hFileMappingObject,
  233. DWORD dwDesiredAccess,
  234. DWORD dwFileOffsetHigh,
  235. DWORD dwFileOffsetLow,
  236. DWORD dwNumberOfBytesToMap
  237. )
  238. {
  239. // We are using fixed memory.
  240. return (LPVOID)hFileMappingObject;
  241. }
  242. BOOL
  243. WINAPI __export
  244. OE16UnmapViewOfFile(
  245. LPCVOID lpBaseAddress
  246. )
  247. {
  248. return TRUE;
  249. }
  250. BOOL
  251. WINAPI __export
  252. OE16CloseFileMapping(
  253. LPVOID lpObject
  254. )
  255. {
  256. LPVOID lpMem;
  257. if( !g_FileMappingList )
  258. return FALSE;
  259. lpMem = g_FileMappingList->FindItemHandleWithName( NULL, lpObject );
  260. // if lpMem is not NULL, it means usagecnt == 0. Let's delete the item.
  261. if( lpMem != NULL )
  262. {
  263. // Delete the item.
  264. g_FileMappingList->DelItem ( (LPVOID)lpMem );
  265. free ( lpMem );
  266. if( g_FileMappingList->IsEmpty() )
  267. {
  268. delete g_FileMappingList;
  269. g_FileMappingList = NULL;
  270. }
  271. }
  272. return TRUE;
  273. }
  274. ///// Got to remove those below related to file mapping object
  275. HANDLE
  276. WINAPI
  277. CreateFileMappingA(
  278. HANDLE hFile,
  279. LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
  280. DWORD flProtect,
  281. DWORD dwMaximumSizeHigh,
  282. DWORD dwMaximumSizeLow,
  283. LPCSTR lpName
  284. )
  285. {
  286. return( NULL );
  287. }
  288. LPVOID
  289. WINAPI
  290. MapViewOfFile(
  291. HANDLE hFileMappingObject,
  292. DWORD dwDesiredAccess,
  293. DWORD dwFileOffsetHigh,
  294. DWORD dwFileOffsetLow,
  295. DWORD dwNumberOfBytesToMap
  296. )
  297. {
  298. return( NULL );
  299. }
  300. BOOL
  301. WINAPI
  302. UnmapViewOfFile(
  303. LPCVOID lpBaseAddress
  304. )
  305. {
  306. return( FALSE );
  307. }
  308. BOOL
  309. WINAPI __export
  310. OE16ReleaseMutex(
  311. HANDLE hMutex
  312. )
  313. {
  314. return( TRUE );
  315. }
  316. BOOL
  317. WINAPI __export
  318. GetDiskFreeSpaceA(
  319. LPCSTR lpRootPathName,
  320. LPDWORD lpSectorsPerCluster,
  321. LPDWORD lpBytesPerSector,
  322. LPDWORD lpNumberOfFreeClusters,
  323. LPDWORD lpTotalNumberOfClusters
  324. )
  325. {
  326. return( FALSE );
  327. }
  328. DWORD
  329. WINAPI __export
  330. GetTimeZoneInformation(
  331. LPTIME_ZONE_INFORMATION lpTimeZoneInformation
  332. )
  333. {
  334. return( 0 );
  335. }
  336. BOOL
  337. WINAPI __export
  338. IsTextUnicode(
  339. CONST LPVOID lpBuffer,
  340. int cb,
  341. LPINT lpi
  342. )
  343. {
  344. return( FALSE );
  345. }
  346. LPVOID
  347. WINAPI __export
  348. VirtualAlloc(
  349. LPVOID lpAddress,
  350. DWORD dwSize,
  351. DWORD flAllocationType,
  352. DWORD flProtect
  353. )
  354. {
  355. lpAddress = (LPVOID) malloc(dwSize);
  356. return lpAddress;
  357. }
  358. BOOL
  359. WINAPI __export
  360. VirtualFree(
  361. LPVOID lpAddress,
  362. DWORD dwSize,
  363. DWORD dwFreeType
  364. )
  365. {
  366. free(lpAddress);
  367. return TRUE;
  368. }
  369. VOID
  370. WINAPI __export
  371. GetSystemInfo(
  372. LPSYSTEM_INFO lpSystemInfo
  373. )
  374. {
  375. lpSystemInfo->dwPageSize = 4096;
  376. }
  377. VOID
  378. WINAPI __export
  379. GetSystemTimeAsFileTime(
  380. LPFILETIME lpSystemTimeAsFileTime
  381. )
  382. {
  383. }
  384. DWORD
  385. WINAPI __export
  386. ExpandEnvironmentStrings(
  387. LPCSTR lpSrc,
  388. LPSTR lpDst,
  389. DWORD nSize
  390. )
  391. {
  392. return ((DWORD) 0);
  393. }
  394. /*****************************************************************************\
  395. * *
  396. * From shlobj.h(INC32)
  397. * *
  398. \*****************************************************************************/
  399. BOOL WINAPI __export SHGetPathFromIDListA( LPCITEMIDLIST pidl, LPSTR pszPath )
  400. {
  401. return( FALSE );
  402. }
  403. LPITEMIDLIST WINAPI __export SHBrowseForFolderA(LPBROWSEINFOA lpbi)
  404. {
  405. return( NULL );
  406. }
  407. HRESULT WINAPI __export
  408. SHGetSpecialFolderLocation( HWND hwndOwner, int nFolder, LPITEMIDLIST* ppidl )
  409. {
  410. return( E_NOTIMPL );
  411. }
  412. /*****************************************************************************\
  413. * *
  414. * From shlobjp.h(private\windows\inc)
  415. * *
  416. \*****************************************************************************/
  417. void WINAPI __export SHFree(LPVOID pv)
  418. {
  419. }
  420. /*****************************************************************************\
  421. * *
  422. * From wingdi.h(INC32)
  423. * *
  424. \*****************************************************************************/
  425. BOOL WINAPI __export TranslateCharsetInfo( DWORD FAR *lpSrc, LPCHARSETINFO lpCs, DWORD dwFlags)
  426. {
  427. return( FALSE );
  428. }
  429. /*****************************************************************************\
  430. * *
  431. * From winuser.h - It should be in the (win16x.h)INC16
  432. * *
  433. \*****************************************************************************/
  434. BOOL
  435. WINAPI __export
  436. EnumThreadWindows(
  437. DWORD dwThreadId,
  438. WNDENUMPROC lpfn,
  439. LPARAM lParam)
  440. {
  441. return( FALSE );
  442. }
  443. int
  444. WINAPI __export
  445. DrawTextEx(
  446. HDC hdc,
  447. LPCSTR lpsz,
  448. int cb,
  449. LPRECT lprc,
  450. UINT fuFormat,
  451. LPVOID lpDTP )
  452. {
  453. Assert( ( fuFormat & ( DT_EDITCONTROL | DT_PATH_ELLIPSIS | DT_END_ELLIPSIS |
  454. DT_MODIFYSTRING | DT_RTLREADING | DT_WORD_ELLIPSIS ) ) == 0 );
  455. Assert( lpDTP == NULL );
  456. return( DrawText( hdc, lpsz, cb, lprc, fuFormat ) );
  457. }
  458. //
  459. // 6/18/97 - Implemented sizing ability only
  460. //
  461. BOOL
  462. WINAPI __export
  463. DrawIconEx(
  464. HDC hdc,
  465. int xLeft,
  466. int yTop,
  467. HICON hIcon,
  468. int cxWidth,
  469. int cyHeight,
  470. UINT istepIfAniCur,
  471. HBRUSH hbrFlickerFreeDraw,
  472. UINT diFlags )
  473. {
  474. int cx = GetSystemMetrics( SM_CXICON );
  475. int cy = GetSystemMetrics( SM_CYICON );
  476. if ( cxWidth == 0 )
  477. cxWidth = cx;
  478. if ( cyHeight == 0 )
  479. cyHeight = cy;
  480. HBITMAP hbmIcon = CreateCompatibleBitmap( hdc, cx, cy );
  481. HDC hdcIcon = CreateCompatibleDC( hdc );
  482. HBITMAP hbmIconOld = (HBITMAP)SelectObject( hdcIcon, hbmIcon );
  483. if ( diFlags & DI_MASK )
  484. {
  485. COLORREF rgbTxt, rgbBk;
  486. HBITMAP hbmMask;
  487. HBITMAP hbmMaskOld;
  488. HDC hdcMask = CreateCompatibleDC( hdc );
  489. hbmMask = CreateCompatibleBitmap( hdcMask, cx, cy );
  490. hbmMaskOld = (HBITMAP)SelectObject( hdcMask, hbmMask );
  491. PatBlt( hdcMask, 0, 0, cx, cy, BLACKNESS );
  492. DrawIcon( hdcMask, 0, 0, hIcon );
  493. PatBlt( hdcIcon, 0, 0, cx, cy, WHITENESS );
  494. DrawIcon( hdcIcon, 0, 0, hIcon );
  495. BitBlt( hdcMask, 0, 0, cx, cy, hdcIcon, 0, 0, SRCINVERT );
  496. rgbTxt = SetTextColor( hdc, RGB( 0, 0, 0 ) );
  497. rgbBk = SetBkColor( hdc, RGB( 255, 255, 255 ) );
  498. StretchBlt( hdc, xLeft, yTop, cxWidth, cyHeight, hdcMask, 0, 0, cx, cy,
  499. ( diFlags & DI_IMAGE ) ? SRCAND : SRCCOPY );
  500. SetTextColor( hdc, rgbTxt );
  501. SetBkColor( hdc, rgbBk );
  502. DeleteObject( SelectObject( hdcMask, hbmMaskOld ) );
  503. DeleteDC( hdcMask );
  504. }
  505. if ( diFlags & DI_IMAGE )
  506. {
  507. PatBlt( hdcIcon, 0, 0, cx, cy, BLACKNESS );
  508. DrawIcon( hdcIcon, 0, 0, hIcon );
  509. StretchBlt( hdc, xLeft, yTop, cxWidth, cyHeight, hdcIcon, 0, 0, cx, cy,
  510. ( diFlags & DI_MASK ) ? SRCINVERT : SRCCOPY );
  511. }
  512. //
  513. // Clean Up
  514. //
  515. DeleteObject( SelectObject( hdcIcon, hbmIconOld ) );
  516. DeleteDC( hdcIcon );
  517. return( TRUE );
  518. }
  519. HANDLE
  520. WINAPI __export
  521. LoadImageA(
  522. HINSTANCE hInst,
  523. LPCSTR lpszName,
  524. UINT uType,
  525. int cxDesired,
  526. int cyDesired,
  527. UINT fuLoad)
  528. {
  529. return LoadBitmap(hInst, lpszName);
  530. }
  531. BOOL
  532. WINAPI __export
  533. PostThreadMessageA(
  534. DWORD idThread,
  535. UINT Msg,
  536. WPARAM wParam,
  537. LPARAM lParam)
  538. {
  539. return( FALSE );
  540. }
  541. #if 0
  542. HICON
  543. WINAPI
  544. CopyIcon(
  545. HICON hIcon)
  546. {
  547. return( NULL );
  548. }
  549. #endif
  550. BOOL
  551. WINAPI __export
  552. TrackPopupMenuEx(
  553. HMENU hMenu,
  554. UINT fuFlags,
  555. int x,
  556. int y,
  557. HWND hwnd,
  558. LPTPMPARAMS lptpm)
  559. {
  560. Assert( ( fuFlags & TPM_RETURNCMD ) == 0 ); // Not supported in Win16
  561. Assert( lptpm == NULL ); // Different meaning in Win16
  562. return( TrackPopupMenu( hMenu, fuFlags, x, y, 0, hwnd, NULL ) );
  563. }
  564. /*****************************************************************************\
  565. * *
  566. * From winnls.h(INC32) - It should be in the (win16x.h)INC16
  567. * *
  568. \*****************************************************************************/
  569. BOOL
  570. WINAPI __export
  571. IsValidCodePage(
  572. UINT CodePage)
  573. {
  574. return( TRUE );
  575. }
  576. #if 0
  577. int
  578. WINAPI
  579. GetTimeFormatA(
  580. LCID Locale,
  581. DWORD dwFlags,
  582. CONST SYSTEMTIME *lpTime,
  583. LPCSTR lpFormat,
  584. LPSTR lpTimeStr,
  585. int cchTime)
  586. {
  587. return( 0 );
  588. }
  589. int
  590. WINAPI
  591. GetDateFormatA(
  592. LCID Locale,
  593. DWORD dwFlags,
  594. CONST SYSTEMTIME *lpDate,
  595. LPCSTR lpFormat,
  596. LPSTR lpDateStr,
  597. int cchDate)
  598. {
  599. return( 0 );
  600. }
  601. #endif
  602. BOOL
  603. WINAPI __export
  604. GetCPInfo(
  605. UINT CodePage,
  606. LPCPINFO lpCPInfo)
  607. {
  608. return( FALSE );
  609. }
  610. BOOL
  611. WINAPI __export
  612. IsDBCSLeadByteEx(
  613. UINT CodePage,
  614. BYTE TestChar)
  615. {
  616. return( FALSE );
  617. }
  618. /*****************************************************************************\
  619. * *
  620. * From wincrypt.h(INC32)
  621. * *
  622. \*****************************************************************************/
  623. // ADVAPI32 and CRYPT32 APIs.
  624. BOOL
  625. WINAPI __export
  626. CryptAcquireContextA(
  627. HCRYPTPROV *phProv,
  628. LPCSTR pszContainer,
  629. LPCSTR pszProvider,
  630. DWORD dwProvType,
  631. DWORD dwFlags)
  632. {
  633. return( FALSE );
  634. }
  635. BOOL
  636. WINAPI __export
  637. CryptReleaseContext(
  638. HCRYPTPROV hProv,
  639. DWORD dwFlags)
  640. {
  641. return( FALSE );
  642. }
  643. BOOL
  644. WINAPI __export
  645. CryptGetProvParam(
  646. HCRYPTPROV hProv,
  647. DWORD dwParam,
  648. BYTE *pbData,
  649. DWORD *pdwDataLen,
  650. DWORD dwFlags)
  651. {
  652. return( FALSE );
  653. }
  654. BOOL
  655. WINAPI __export
  656. CryptSetProvParam(
  657. HCRYPTPROV hProv,
  658. DWORD dwParam,
  659. BYTE *pbData,
  660. DWORD dwFlags)
  661. {
  662. return( FALSE );
  663. }
  664. BOOL
  665. WINAPI __export
  666. CryptGenKey(
  667. HCRYPTPROV hProv,
  668. ALG_ID Algid,
  669. DWORD dwFlags,
  670. HCRYPTKEY *phKey)
  671. {
  672. return( FALSE );
  673. }
  674. BOOL
  675. WINAPI __export
  676. CryptDestroyKey(
  677. HCRYPTKEY hKey)
  678. {
  679. return( FALSE );
  680. }
  681. DWORD
  682. WINAPI __export
  683. CertNameToStrA(
  684. IN DWORD dwCertEncodingType,
  685. IN PCERT_NAME_BLOB pName,
  686. IN DWORD dwStrType,
  687. OUT OPTIONAL LPSTR psz,
  688. IN DWORD csz
  689. )
  690. {
  691. return( FALSE );
  692. }
  693. PCCERT_CONTEXT
  694. WINAPI __export
  695. CertFindCertificateInStore(
  696. IN HCERTSTORE hCertStore,
  697. IN DWORD dwCertEncodingType,
  698. IN DWORD dwFindFlags,
  699. IN DWORD dwFindType,
  700. IN const void *pvFindPara,
  701. IN PCCERT_CONTEXT pPrevCertContext
  702. )
  703. {
  704. return( NULL );
  705. }
  706. LONG
  707. WINAPI __export
  708. CertVerifyTimeValidity(
  709. IN LPFILETIME pTimeToVerify,
  710. IN PCERT_INFO pCertInfo
  711. )
  712. {
  713. return( 0 );
  714. }
  715. BOOL
  716. WINAPI __export
  717. CryptDecodeObject(
  718. IN DWORD dwCertEncodingType,
  719. IN LPCSTR lpszStructType,
  720. IN const BYTE *pbEncoded,
  721. IN DWORD cbEncoded,
  722. IN DWORD dwFlags,
  723. OUT void *pvStructInfo,
  724. IN OUT DWORD *pcbStructInfo
  725. )
  726. {
  727. return( FALSE );
  728. }
  729. BOOL
  730. WINAPI __export
  731. CertGetCertificateContextProperty(
  732. IN PCCERT_CONTEXT pCertContext,
  733. IN DWORD dwPropId,
  734. OUT void *pvData,
  735. IN OUT DWORD *pcbData
  736. )
  737. {
  738. return( FALSE );
  739. }
  740. BOOL
  741. WINAPI __export
  742. CryptEncodeObject(
  743. IN DWORD dwCertEncodingType,
  744. IN LPCSTR lpszStructType,
  745. IN const void *pvStructInfo,
  746. OUT BYTE *pbEncoded,
  747. IN OUT DWORD *pcbEncoded
  748. )
  749. {
  750. return( FALSE );
  751. }
  752. BOOL
  753. WINAPI __export
  754. CertCloseStore(
  755. IN HCERTSTORE hCertStore,
  756. DWORD dwFlags
  757. )
  758. {
  759. return( FALSE );
  760. }
  761. BOOL
  762. WINAPI __export
  763. CertFreeCertificateContext(
  764. IN PCCERT_CONTEXT pCertContext
  765. )
  766. {
  767. return( FALSE );
  768. }
  769. PCCERT_CONTEXT
  770. WINAPI __export
  771. CertDuplicateCertificateContext(
  772. IN PCCERT_CONTEXT pCertContext
  773. )
  774. {
  775. return( NULL );
  776. }
  777. HCERTSTORE
  778. WINAPI __export
  779. CertDuplicateStore(
  780. IN HCERTSTORE hCertStore
  781. )
  782. {
  783. return( NULL );
  784. }
  785. HCERTSTORE
  786. WINAPI __export
  787. CertOpenStore(
  788. IN LPCSTR lpszStoreProvider,
  789. IN DWORD dwEncodingType,
  790. IN HCRYPTPROV hCryptProv,
  791. IN DWORD dwFlags,
  792. IN const void *pvPara
  793. )
  794. {
  795. return( NULL );
  796. }
  797. BOOL
  798. WINAPI __export
  799. CryptMsgClose(
  800. IN HCRYPTMSG hCryptMsg
  801. )
  802. {
  803. return( FALSE );
  804. }
  805. BOOL
  806. WINAPI __export
  807. CryptMsgUpdate(
  808. IN HCRYPTMSG hCryptMsg,
  809. IN const BYTE *pbData,
  810. IN DWORD cbData,
  811. IN BOOL fFinal
  812. )
  813. {
  814. return( FALSE );
  815. }
  816. BOOL
  817. WINAPI __export
  818. CryptMsgGetParam(
  819. IN HCRYPTMSG hCryptMsg,
  820. IN DWORD dwParamType,
  821. IN DWORD dwIndex,
  822. OUT void *pvData,
  823. IN OUT DWORD *pcbData
  824. )
  825. {
  826. return( FALSE );
  827. }
  828. HCRYPTMSG
  829. WINAPI __export
  830. CryptMsgOpenToEncode(
  831. IN DWORD dwMsgEncodingType,
  832. IN DWORD dwFlags,
  833. IN DWORD dwMsgType,
  834. IN void const *pvMsgEncodeInfo,
  835. IN OPTIONAL LPSTR pszInnerContentObjID,
  836. IN OPTIONAL PCMSG_STREAM_INFO pStreamInfo
  837. )
  838. {
  839. return( NULL );
  840. }
  841. HCRYPTMSG
  842. WINAPI __export
  843. CryptMsgOpenToDecode(
  844. IN DWORD dwMsgEncodingType,
  845. IN DWORD dwFlags,
  846. IN DWORD dwMsgType,
  847. IN HCRYPTPROV hCryptProv,
  848. IN OPTIONAL PCERT_INFO pRecipientInfo,
  849. IN OPTIONAL PCMSG_STREAM_INFO pStreamInfo
  850. )
  851. {
  852. return( NULL );
  853. }
  854. PCCERT_CONTEXT
  855. WINAPI __export
  856. CertGetSubjectCertificateFromStore(
  857. IN HCERTSTORE hCertStore,
  858. IN DWORD dwCertEncodingType,
  859. IN PCERT_INFO pCertId // Only the Issuer and SerialNumber
  860. // fields are used
  861. )
  862. {
  863. return( NULL );
  864. }
  865. BOOL
  866. WINAPI __export
  867. CryptMsgControl(
  868. IN HCRYPTMSG hCryptMsg,
  869. IN DWORD dwFlags,
  870. IN DWORD dwCtrlType,
  871. IN void const *pvCtrlPara
  872. )
  873. {
  874. return( FALSE );
  875. }
  876. BOOL
  877. WINAPI __export
  878. CertCompareCertificate(
  879. IN DWORD dwCertEncodingType,
  880. IN PCERT_INFO pCertId1,
  881. IN PCERT_INFO pCertId2
  882. )
  883. {
  884. return( FALSE );
  885. }
  886. #if 0
  887. /*****************************************************************************\
  888. * *
  889. * From winreg.h(INC32)
  890. * *
  891. \*****************************************************************************/
  892. LONG
  893. APIENTRY
  894. RegEnumValueA (
  895. HKEY hKey,
  896. DWORD dwIndex,
  897. LPSTR lpValueName,
  898. LPDWORD lpcbValueName,
  899. LPDWORD lpReserved,
  900. LPDWORD lpType,
  901. LPBYTE lpData,
  902. LPDWORD lpcbData
  903. )
  904. {
  905. return( 0xFFFFFFFFL );
  906. }
  907. #endif
  908. /*****************************************************************************\
  909. * *
  910. * From shellapi.h(INC32)
  911. * *
  912. \*****************************************************************************/
  913. DWORD WINAPI __export
  914. SHGetFileInfoA(LPCSTR pszPath, DWORD dwFileAttributes, SHFILEINFOA FAR *psfi, UINT cbFileInfo, UINT uFlags)
  915. {
  916. Assert( ( uFlags & SHGFI_PIDL ) == 0 );
  917. if ( uFlags & SHGFI_ICON )
  918. psfi->hIcon = NULL;
  919. // psfi->hIcon = CopyIcon( (HINSTANCE)GetCurrentTask(), LoadIcon( NULL, IDI_APPLICATION ) );
  920. if ( uFlags & SHGFI_DISPLAYNAME )
  921. StrCpyN( psfi->szDisplayName, pszPath, ARRAYSIZE(psfi->szDisplayName) );
  922. if ( uFlags & SHGFI_TYPENAME )
  923. StrCpyN( psfi->szTypeName, "Type Name", ARRAYSIZE(psfi->szTypeName) );
  924. return( 0 );
  925. }
  926. BOOL WINAPI __export Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA lpData)
  927. {
  928. return( FALSE );
  929. }
  930. BOOL WINAPI __export Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW lpData)
  931. {
  932. return( FALSE );
  933. }
  934. BOOL WINAPI __export ShellExecuteExA(LPSHELLEXECUTEINFOA lpExecInfo)
  935. {
  936. return( FALSE );
  937. }
  938. BOOL WINAPI __export ShellExecuteExW(LPSHELLEXECUTEINFOW lpExecInfo)
  939. {
  940. return( FALSE );
  941. }
  942. HICON WINAPI __export
  943. ExtractAssociatedIcon( HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon )
  944. {
  945. return( NULL );
  946. }
  947. #if 0
  948. /*****************************************************************************\
  949. * *
  950. * From INETCOMM
  951. * *
  952. \*****************************************************************************/
  953. IMNACCTAPI HRESULT HrCreateAccountManager(IImnAccountManager **ppAccountManager)
  954. {
  955. return( E_NOTIMPL );
  956. }
  957. #endif
  958. /*****************************************************************************\
  959. * *
  960. * From WIN16X(INC16) - missing APIs
  961. * *
  962. \*****************************************************************************/
  963. BOOL
  964. WINAPI __export
  965. GetVersionEx(
  966. LPOSVERSIONINFOA lpVersionInformation
  967. )
  968. {
  969. return( FALSE );
  970. }
  971. BOOL WINAPI __export GetStringTypeEx(
  972. LCID Locale,
  973. DWORD dwInfoType,
  974. LPCTSTR lpSrcStr,
  975. int cchSrc,
  976. LPWORD lpCharType
  977. )
  978. {
  979. *lpCharType = 0;
  980. if(dwInfoType == CT_CTYPE1)
  981. {
  982. // Simple bug fix for IsDigit.
  983. if(lpSrcStr[0] >= '0' && lpSrcStr[0] <= '9')
  984. *lpCharType |= C1_DIGIT;
  985. }
  986. return( TRUE );
  987. }
  988. HPALETTE WINAPI __export CreateHalftonePalette(HDC hDC)
  989. {
  990. return( NULL );
  991. }
  992. BOOL WINAPI __export StretchBlt32(HDC, int, int, int, int, HDC, int, int, int, int, DWORD)
  993. {
  994. return( FALSE );
  995. }
  996. STDAPI __export
  997. LoadTypeLib(const OLECHAR FAR* szFile, ITypeLib FAR* FAR* pptlib)
  998. {
  999. return( E_NOTIMPL );
  1000. }
  1001. STDAPI __export
  1002. RegisterTypeLib(
  1003. ITypeLib FAR* ptlib,
  1004. OLECHAR FAR* szFullPath,
  1005. OLECHAR FAR* szHelpDir)
  1006. {
  1007. return( E_NOTIMPL );
  1008. }
  1009. HWND WINAPI __export
  1010. HtmlHelpA( HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD dwData )
  1011. {
  1012. return( NULL );
  1013. }
  1014. } // extern "C"
  1015. #if 0
  1016. /*****************************************************************************\
  1017. * *
  1018. * From NEWS
  1019. * *
  1020. \*****************************************************************************/
  1021. //
  1022. // NOTE: This function must be CPP
  1023. //
  1024. void Output(HWND hwnd, int id, LPSTR sz)
  1025. {
  1026. }
  1027. /*****************************************************************************\
  1028. * *
  1029. * From PSTOREC
  1030. * *
  1031. \*****************************************************************************/
  1032. BOOL __stdcall GetPStoreProvider(
  1033. IPStoreProvider __RPC_FAR *__RPC_FAR *ppProvider,
  1034. PPST_PROVIDERINFO pProviderInfo,
  1035. DWORD dwReserved)
  1036. {
  1037. return( FALSE );
  1038. }
  1039. BOOL __stdcall EnumPStoreProviders(
  1040. DWORD dwFlags,
  1041. IEnumPStoreProviders __RPC_FAR *__RPC_FAR *ppenum)
  1042. {
  1043. return( FALSE );
  1044. }
  1045. #endif
  1046. /*****************************************************************************\
  1047. * *
  1048. * From Shlwapi.h(INC16) - SHLWAPI APIs
  1049. * *
  1050. \*****************************************************************************/
  1051. STDAPI_(LPSTR) __export
  1052. PathFindExtensionA(LPCSTR pszPath)
  1053. {
  1054. return( NULL );
  1055. }
  1056. STDAPI_(LPSTR) __export
  1057. PathFindFileNameA(LPCSTR pszPath)
  1058. {
  1059. return( NULL );
  1060. }
  1061. STDAPI_(LPSTR) __export
  1062. StrStrA(LPCSTR lpFirst, LPCSTR lpSrch)
  1063. {
  1064. return( NULL );
  1065. }
  1066. STDAPI_(LPSTR) __export
  1067. StrFormatByteSizeA(DWORD dw, LPSTR szBuf, UINT uiBufSize)
  1068. {
  1069. return( NULL );
  1070. }
  1071. /*****************************************************************************\
  1072. * *
  1073. * From Shlwapip.h(INC16) - SHLWAPI APIs
  1074. * *
  1075. \*****************************************************************************/
  1076. STDAPI_(HRESULT) __export
  1077. UrlUnescapeA(
  1078. LPSTR pszUrl,
  1079. LPSTR pszUnescaped,
  1080. LPDWORD pcchUnescaped,
  1081. DWORD dwFlags)
  1082. {
  1083. return( NULL );
  1084. }