PageRenderTime 60ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/harbour-1.0.0RC1/contrib/hbwhat32/_wininet.c

#
C | 625 lines | 214 code | 60 blank | 351 comment | 12 complexity | dc55ad06b3fa190bd4237c2273973243 MD5 | raw file
Possible License(s): AGPL-1.0, BSD-3-Clause, CC-BY-SA-3.0, LGPL-3.0, GPL-2.0, LGPL-2.0, LGPL-2.1
  1. /*
  2. * $Id: _wininet.c 8045 2007-11-25 18:36:59Z vouchcac $
  3. */
  4. //---------------------------------------------------------------------//
  5. //---------------------------------------------------------------------//
  6. //---------------------------------------------------------------------//
  7. //
  8. // Internet Functions
  9. //
  10. // Requires WinINet.dll and WinInet.h
  11. //
  12. //
  13. // Pritpal Bedi <vouch32@vouchcac.com>
  14. //
  15. //---------------------------------------------------------------------//
  16. //---------------------------------------------------------------------//
  17. //---------------------------------------------------------------------//
  18. #define _WIN32_WINNT 0x0400
  19. #define _WIN32_IE 0x0500
  20. #ifndef __MINGW32__
  21. #ifndef __WATCOMC__
  22. #include <windows.h>
  23. #include <commctrl.h>
  24. #include <shlobj.h>
  25. #include <shellApi.h>
  26. #include <wininet.h>
  27. #include "hbapi.h"
  28. #include "hbvm.h"
  29. #include "hbstack.h"
  30. #include "hbapiitm.h"
  31. #include "winreg.h"
  32. //---------------------------------------------------------------------//
  33. /*
  34. DWORD InternetDial(
  35. IN HWND hwndParent,
  36. IN LPTSTR lpszConnectoid,
  37. IN DWORD dwFlags,
  38. OUT LPDWORD lpdwConnection,
  39. IN DWORD dwReserved
  40. );
  41. */
  42. //
  43. // InternetDial()
  44. //
  45. HB_FUNC( INTERNETDIAL )
  46. {
  47. HWND hWnd = ISNIL( 1 ) ? 0 : ( HWND ) hb_parnl( 1 ) ;
  48. LPTSTR lpszId = ISNIL( 2 ) ? NULL : hb_parcx( 2 ) ;
  49. DWORD nFlags = INTERNET_AUTODIAL_FORCE_ONLINE ;
  50. DWORD nRet = 0;
  51. hb_retnl( InternetDial( hWnd, lpszId, nFlags, &nRet, 0 ) );
  52. }
  53. //---------------------------------------------------------------------//
  54. /*
  55. BOOL InternetGetConnectedState(
  56. OUT LPDWORD lpdwFlags,
  57. IN DWORD dwReserved
  58. );
  59. */
  60. //
  61. // lIsOn := InternetGetConnectedState()
  62. //
  63. HB_FUNC( INTERNETGETCONNECTEDSTATE )
  64. {
  65. hb_retl( InternetGetConnectedState( NULL, 0 ) ) ;
  66. }
  67. //---------------------------------------------------------------------//
  68. /*
  69. HINTERNET InternetOpen(
  70. IN LPCTSTR lpszAgent,
  71. IN DWORD dwAccessType,
  72. IN LPCTSTR lpszProxyName,
  73. IN LPCTSTR lpszProxyBypass,
  74. IN DWORD dwFlags
  75. );
  76. */
  77. //
  78. // hInternet := InternetOpen()
  79. // if hInternet <> 0
  80. // hFtp := InternetConnect( hInternet, 'vouchcac.com', ;
  81. // INTERNET_DEFAULT_FTP_PORT, cUserName, cPassword, ;
  82. // INTERNET_SERVICE_FTP )
  83. // if hFtp <> 0
  84. // if FtpOpenFile( hFtp, 'Temp/Testing.txt', GENERIC_WRITE )
  85. // cBuffer := 'This is testing string' + chr( 13 ) + chr( 10 )
  86. // lSuccess := InternetWrite( hFtp, cBuffer, len( cBuffer ), @nWritten )
  87. // if lSuccess
  88. // ? nWritten
  89. // endif
  90. // endif
  91. // InternetCloseHandle( hFtp )
  92. // endif
  93. // InternetCloseHandle( hInternet )
  94. // endif
  95. //
  96. //
  97. //
  98. HB_FUNC( INTERNETOPEN )
  99. {
  100. LPCTSTR lpszAgent = ISNIL( 1 ) ? NULL : hb_parcx( 1 ) ;
  101. DWORD dwAccessType = ISNIL( 2 ) ? INTERNET_OPEN_TYPE_DIRECT : hb_parnl( 2 ) ;
  102. LPCTSTR lpszProxyName = ISNIL( 3 ) ? NULL : hb_parcx( 3 ) ;
  103. LPCTSTR lpszProxyBypass = ISNIL( 4 ) ? NULL : hb_parcx( 4 ) ;
  104. DWORD dwFlags = ISNIL( 5 ) ? 0 : hb_parnl( 5 ) ;
  105. hb_retnl( ( ULONG ) InternetOpen( lpszAgent, dwAccessType, lpszProxyName, lpszProxyBypass, dwFlags ) ) ;
  106. }
  107. //---------------------------------------------------------------------//
  108. /*
  109. HINTERNET InternetConnect(
  110. IN HINTERNET hInternet,
  111. IN LPCTSTR lpszServerName,
  112. IN INTERNET_PORT nServerPort,
  113. IN LPCTSTR lpszUserName,
  114. IN LPCTSTR lpszPassword,
  115. IN DWORD dwService,
  116. IN DWORD dwFlags,
  117. IN DWORD_PTR dwContext
  118. );
  119. */
  120. //
  121. // hFtp := InternetConnect( hInternet, 'chcac.com', ;
  122. // INTERNET_DEFAULT_FTP_PORT, cUserName, cPassword, ;
  123. // INTERNET_SERVICE_FTP )
  124. //
  125. HB_FUNC( INTERNETCONNECT )
  126. {
  127. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  128. LPCTSTR lpszServerName = hb_parcx( 2 ) ;
  129. INTERNET_PORT nServerPort = ISNIL( 3 ) ? INTERNET_DEFAULT_HTTP_PORT : hb_parni( 3 ) ;
  130. LPCTSTR lpszUserName = ISNIL( 4 ) ? NULL : hb_parcx( 4 ) ;
  131. LPCTSTR lpszPassword = ISNIL( 5 ) ? NULL : hb_parcx( 5 ) ;
  132. DWORD dwService = ISNIL( 6 ) ? INTERNET_SERVICE_HTTP : hb_parnl( 6 ) ;
  133. DWORD dwFlags = ISNIL( 7 ) ? 0 : hb_parnl( 7 ) ;
  134. DWORD_PTR dwContext = ISNIL( 8 ) ? 0 : hb_parnl( 8 ) ;
  135. hb_retnl( ( ULONG ) InternetConnect( hInternet, lpszServerName,
  136. nServerPort, lpszUserName, lpszPassword,
  137. dwService, dwFlags, dwContext ) ) ;
  138. }
  139. //---------------------------------------------------------------------//
  140. /*
  141. HINTERNET FtpOpenFile(
  142. IN HINTERNET hConnect,
  143. IN LPCTSTR lpszFileName,
  144. IN DWORD dwAccess,
  145. IN DWORD dwFlags,
  146. IN DWORD_PTR dwContext
  147. );
  148. */
  149. //
  150. // if FtpOpenFile( hInternet, 'Temp/Config.sys', GENERIC_WRITE )
  151. // // take next step
  152. // endif
  153. //
  154. HB_FUNC( FTPOPENFILE )
  155. {
  156. HINTERNET hFtp = ( HINTERNET ) hb_parnl( 1 ) ;
  157. LPCTSTR lpszFileName = hb_parcx( 2 ) ;
  158. DWORD dwAccess = ISNIL( 3 ) ? GENERIC_READ : hb_parni( 3 ) ;
  159. DWORD dwFlags = ISNIL( 4 ) ? FTP_TRANSFER_TYPE_BINARY : hb_parni( 4 ) ;
  160. DWORD_PTR dwContext = ISNIL( 5 ) ? 0 : hb_parnl( 5 ) ;
  161. hb_retl( FtpOpenFile( hFtp, lpszFileName, dwAccess, dwFlags, dwContext ) != NULL ) ;
  162. }
  163. //---------------------------------------------------------------------//
  164. /*
  165. BOOL InternetWriteFile(
  166. IN HINTERNET hFile,
  167. IN LPCVOID lpBuffer,
  168. IN DWORD dwNumberOfBytesToWrite,
  169. OUT LPDWORD lpdwNumberOfBytesWritten
  170. );
  171. */
  172. //
  173. // if InternetWriteFile( hFile, @cBuffer, len( cBuffer ), @nWritten )
  174. // // Take next step
  175. // endif
  176. //
  177. HB_FUNC( INTERNETWRITEFILE )
  178. {
  179. HINTERNET hFile = ( HINTERNET ) hb_parnl( 1 ) ;
  180. LPCVOID lpBuffer = hb_parcx( 2 ) ;
  181. DWORD dwNumberOfBytesToWrite = ( DWORD ) hb_parnl( 3 ) ;
  182. LPDWORD lpdwNumberOfBytesWritten = ( LPDWORD ) 0 ;
  183. hb_retl( InternetWriteFile( hFile, lpBuffer, dwNumberOfBytesToWrite,
  184. lpdwNumberOfBytesWritten ) ) ;
  185. if ISBYREF( 4 )
  186. hb_stornl( ( ULONG ) lpdwNumberOfBytesWritten, 4 ) ;
  187. }
  188. //---------------------------------------------------------------------//
  189. /*
  190. BOOL InternetReadFile(
  191. IN HINTERNET hFile,
  192. IN LPVOID lpBuffer,
  193. IN DWORD dwNumberOfBytesToRead,
  194. OUT LPDWORD lpdwNumberOfBytesRead
  195. );
  196. */
  197. //
  198. // if InternetReadFile( hFile, @cBuffer, len( cBuffer ), @nRead )
  199. // // Write to local handle
  200. // endif
  201. //
  202. HB_FUNC( INTERNETREADFILE )
  203. {
  204. HINTERNET hFile = ( HINTERNET ) hb_parnl( 1 ) ;
  205. LPCVOID lpBuffer = hb_parcx( 2 ) ;
  206. DWORD dwNumberOfBytesToRead = ( DWORD ) hb_parnl( 3 ) ;
  207. LPDWORD lpdwNumberOfBytesRead = ( LPDWORD ) 0 ;
  208. BOOL bRet ;
  209. bRet = InternetReadFile( hFile, &lpBuffer,
  210. dwNumberOfBytesToRead, lpdwNumberOfBytesRead ) ;
  211. hb_retl( bRet );
  212. if ( bRet )
  213. {
  214. if ISBYREF( 4 )
  215. {
  216. hb_stornl( ( ULONG ) lpdwNumberOfBytesRead, 4 ) ;
  217. }
  218. hb_storclen( ( char * ) lpBuffer, ( ULONG ) lpdwNumberOfBytesRead, 2 ) ;
  219. }
  220. }
  221. //---------------------------------------------------------------------//
  222. /*
  223. BOOL FtpCommand(
  224. IN HINTERNET hConnect,
  225. IN BOOL fExpectResponse,
  226. IN DWORD dwFlags,
  227. IN LPCTSTR lpszCommand,
  228. IN DWORD_PTR dwContext,
  229. OUT HINTERNET *phFtpCommand
  230. );
  231. */
  232. //
  233. //
  234. //
  235. HB_FUNC( FTPCOMMAND )
  236. {
  237. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  238. BOOL fExpectResponse = ISNIL( 2 ) ? 0 : hb_parl( 2 ) ;
  239. DWORD dwFlags = ISNIL( 3 ) ? FTP_TRANSFER_TYPE_BINARY : hb_parnl( 3 ) ;
  240. LPCTSTR lpszCommand = hb_parcx( 4 ) ;
  241. DWORD_PTR dwContext = ISNIL( 5 ) ? 0 : hb_parnl( 5 ) ;
  242. HINTERNET phFtpCommand ;
  243. BOOL bRet ;
  244. bRet = FtpCommand( hInternet, fExpectResponse, dwFlags, lpszCommand,
  245. dwContext, &phFtpCommand ) ;
  246. hb_retl( bRet ) ;
  247. if ( bRet )
  248. {
  249. if ( ISBYREF( 6 ) )
  250. hb_stornl( ( ULONG ) phFtpCommand, 6 ) ;
  251. }
  252. }
  253. //---------------------------------------------------------------------//
  254. /*
  255. HINTERNET FtpFindFirstFile(
  256. IN HINTERNET hConnect,
  257. IN LPCTSTR lpszSearchFile,
  258. OUT LPWIN32_FIND_DATA lpFindFileData,
  259. IN DWORD dwFlags,
  260. IN DWORD_PTR dwContext
  261. );
  262. */
  263. //
  264. // #include 'WinTypes.ch'
  265. // #include 'cStruct.ch'
  266. //
  267. //
  268. // pragma pack(4)
  269. //
  270. // typedef struct { ;
  271. // DWORD dwLowDateTime;
  272. // DWORD dwHighDateTime;
  273. // } FILETIME
  274. //
  275. // typedef struct { ;
  276. // DWORD dwFileAttributes;
  277. // FILETIME ftCreationTime;
  278. // FILETIME ftLastAccessTime;
  279. // FILETIME ftLastWriteTime;
  280. // DWORD nFileSizeHigh;
  281. // DWORD nFileSizeLow;
  282. // DWORD dwReserved0;
  283. // DWORD dwReserved1;
  284. // char cFileName[ MAX_PATH ];
  285. // char cAlternateFileName[ 14 ];
  286. // } WIN32_FIND_DATA
  287. //
  288. //
  289. //
  290. // Function FtpDirectory( hInternet, cFileSpec )
  291. // local hFile
  292. // local FindData IS WIN32_FIND_DATA
  293. // local cDirInfo := FindData:value
  294. //
  295. // DEFAULT cFileSpec TO '*.*'
  296. //
  297. // hFind := FtpFindFirstFile( hInternet, cFileSpec, @cDirInfo )
  298. // if hFind <> 0
  299. // FindData:Buffer( cDirInfo )
  300. //
  301. // ? FindData:cFileName:value // Name
  302. // ? FindData:dwFileAttributes // Attribute in numeric, 16 for directory, 128 for file
  303. // ? FindData:nFileSizeLow // Size in bytes
  304. // ? findData:ftLastWriteTime:dwHighDateTime // Date, time in DWORD
  305. //
  306. // do while .t.
  307. // if !InternetFindNextFile( hFind, @cDirInfo )
  308. // exit
  309. // endif
  310. // FindData:Buffer( cDirInfo )
  311. //
  312. // ? FindData:cFileName:value // Name
  313. // ? FindData:dwFileAttributes // Attribute in numeric, 16 for directory, 128 for file
  314. // ? FindData:nFileSizeLow // Size in bytes
  315. // ? findData:ftLastWriteTime:dwHighDateTime // Date, time in DWORD
  316. // enddo
  317. //
  318. // endif
  319. //
  320. // return nil
  321. //
  322. //
  323. HB_FUNC( FTPFINDFIRSTFILE )
  324. {
  325. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  326. LPCTSTR lpszSearchFile = ISNIL( 2 ) ? TEXT ("*.*") : hb_parcx( 2 ) ;
  327. WIN32_FIND_DATA FindFileData ;
  328. DWORD dwFlags = ISNIL( 4 ) ? INTERNET_FLAG_NEED_FILE : hb_parnl( 4 ) ;
  329. DWORD_PTR dwContext = ISNIL( 5 ) ? 0 : hb_parnl( 5 ) ;
  330. HINTERNET hResult ;
  331. hResult = FtpFindFirstFile( hInternet, lpszSearchFile,
  332. &FindFileData, dwFlags, dwContext ) ;
  333. if ( hResult )
  334. if ( ISBYREF( 3 ) )
  335. hb_storclen( (char *) &FindFileData , sizeof( WIN32_FIND_DATA ), 3 ) ;
  336. hb_retnl( ( ULONG ) hResult ) ;
  337. }
  338. //---------------------------------------------------------------------//
  339. /*
  340. BOOL InternetFindNextFile(
  341. IN HINTERNET hFind,
  342. OUT LPVOID lpvFindData
  343. );
  344. */
  345. //
  346. HB_FUNC( INTERNETFINDNEXTFILE )
  347. {
  348. HINTERNET hFind = ( HINTERNET ) hb_parnl( 1 ) ;
  349. WIN32_FIND_DATA FindFileData ;
  350. if ( InternetFindNextFile( hFind, &FindFileData ) )
  351. {
  352. hb_retl( TRUE ) ;
  353. if ( ISBYREF( 2 ) )
  354. hb_storclen( ( char * ) &FindFileData, sizeof( WIN32_FIND_DATA ), 2 ) ;
  355. }
  356. else
  357. hb_retl( FALSE ) ;
  358. }
  359. //---------------------------------------------------------------------//
  360. /*
  361. BOOL FtpGetFile(
  362. IN HINTERNET hConnect,
  363. IN LPCTSTR lpszRemoteFile,
  364. IN LPCTSTR lpszNewFile,
  365. IN BOOL fFailIfExists,
  366. IN DWORD dwFlagsAndAttributes,
  367. IN DWORD dwFlags,
  368. IN DWORD_PTR dwContext
  369. );
  370. */
  371. //
  372. // if FtpGetFile( hInternet, cRemoteFile, cLocalFile, lFailIfExist )
  373. // ? 'Success'
  374. // endif
  375. //
  376. HB_FUNC( FTPGETFILE )
  377. {
  378. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  379. LPCTSTR lpszRemoteFile = hb_parcx( 2 ) ;
  380. LPCTSTR lpszLocalFile = hb_parcx( 3 ) ;
  381. BOOL fFailIfExist = ISNIL( 4 ) ? FALSE : hb_parl( 4 ) ;
  382. DWORD dwFlagsAndAttributes = ISNIL( 5 ) ? FILE_ATTRIBUTE_NORMAL : hb_parnl( 5 ) ;
  383. DWORD dwFlags = ISNIL( 6 ) ? FTP_TRANSFER_TYPE_BINARY | INTERNET_FLAG_RELOAD : hb_parnl( 6 ) ;
  384. DWORD_PTR dwContext = ISNIL( 7 ) ? 0 : hb_parnl( 7 ) ;
  385. hb_retl( FtpGetFile( hInternet, lpszRemoteFile, lpszLocalFile,
  386. fFailIfExist, dwFlagsAndAttributes,
  387. dwFlags, dwContext ) ) ;
  388. }
  389. //---------------------------------------------------------------------//
  390. /*
  391. BOOL FtpPutFile(
  392. IN HINTERNET hConnect,
  393. IN LPCTSTR lpszLocalFile,
  394. IN LPCTSTR lpszNewRemoteFile,
  395. IN DWORD dwFlags,
  396. IN DWORD_PTR dwContext
  397. );
  398. */
  399. //
  400. // if FtpPutFile( hInternet, cLocalFile, cRemoteFile )
  401. // ?
  402. // endif
  403. //
  404. HB_FUNC( FTPPUTFILE )
  405. {
  406. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  407. LPCTSTR lpszLocalFile = hb_parcx( 2 ) ;
  408. LPCTSTR lpszRemoteFile = hb_parcx( 3 ) ;
  409. DWORD dwFlags = ISNIL( 4 ) ? FTP_TRANSFER_TYPE_BINARY | INTERNET_FLAG_RELOAD : hb_parnl( 4 ) ;
  410. DWORD_PTR dwContext = ISNIL( 5 ) ? 0 : hb_parnl( 5 ) ;
  411. hb_retl( FtpPutFile( hInternet, lpszLocalFile, lpszRemoteFile, dwFlags, dwContext ) ) ;
  412. }
  413. //---------------------------------------------------------------------//
  414. /*
  415. BOOL FtpCreateDirectory(
  416. IN HINTERNET hConnect,
  417. IN LPCTSTR lpszDirectory
  418. );
  419. */
  420. //
  421. // if FtpCreateDirectory( hInternet, 'Temp' )
  422. // ? 'Success'
  423. // endif
  424. //
  425. HB_FUNC( FTPCREATEDIRECTORY )
  426. {
  427. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  428. LPCTSTR lpszDirectory = hb_parcx( 2 ) ;
  429. hb_retl( FtpCreateDirectoryA( hInternet, lpszDirectory ) ) ;
  430. }
  431. //---------------------------------------------------------------------//
  432. /*
  433. BOOL FtpRemoveDirectory(
  434. IN HINTERNET hConnect,
  435. IN LPCTSTR lpszDirectory
  436. );
  437. */
  438. //
  439. // if FtpRemoveDirectory( hInternet, cDirectory )
  440. // ? 'Success'
  441. // endif
  442. //
  443. HB_FUNC( FTPREMOVEDIRECTORY )
  444. {
  445. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  446. LPCTSTR lpszDirectory = hb_parcx( 2 ) ;
  447. hb_retl( FtpRemoveDirectoryA( hInternet, lpszDirectory ) ) ;
  448. }
  449. //---------------------------------------------------------------------//
  450. /*
  451. BOOL FtpDeleteFile(
  452. IN HINTERNET hConnect,
  453. IN LPCTSTR lpszFileName
  454. );
  455. */
  456. //
  457. // if FtpDeleteFile( hInternet, 'Temp\Config.sys' )
  458. // ? 'Sucess'
  459. // endif
  460. //
  461. HB_FUNC( FTPDELETEFILE )
  462. {
  463. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  464. LPCTSTR lpszFileName = hb_parcx( 2 ) ;
  465. hb_retl( FtpDeleteFile( hInternet, lpszFileName ) ) ;
  466. }
  467. //---------------------------------------------------------------------//
  468. /*
  469. BOOL FtpRenameFile(
  470. IN HINTERNET hConnect,
  471. IN LPCTSTR lpszExisting,
  472. IN LPCTSTR lpszNew
  473. );
  474. */
  475. //
  476. // if FtpRenameFile( hInternet, cExisting, cNew )
  477. // ? 'Success'
  478. // endif
  479. //
  480. HB_FUNC( FTPRENAMEFILE )
  481. {
  482. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  483. LPCTSTR lpszExisting = hb_parcx( 2 ) ;
  484. LPCTSTR lpszNew = hb_parcx( 3 ) ;
  485. hb_retl( FtpRenameFileA( hInternet, lpszExisting, lpszNew ) ) ;
  486. }
  487. //---------------------------------------------------------------------//
  488. /*
  489. BOOL FtpGetCurrentDirectory(
  490. IN HINTERNET hConnect,
  491. OUT LPTSTR lpszCurrentDirectory,
  492. IN OUT LPDWORD lpdwCurrentDirectory
  493. );
  494. */
  495. //
  496. // if FtpGetCurrentDirectory( hInternet, @cDirectory )
  497. // ? cDirectory
  498. // endif
  499. //
  500. HB_FUNC( FTPGETCURRENTDIRECTORY )
  501. {
  502. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  503. LPTSTR lpszCurrentDirectory = ( LPTSTR ) hb_xgrab( MAX_PATH ) ;
  504. DWORD dwCurrentDirectory = MAX_PATH ;
  505. BOOL bRet ;
  506. bRet = FtpGetCurrentDirectory( hInternet, lpszCurrentDirectory, &dwCurrentDirectory ) ;
  507. hb_retl( bRet ) ;
  508. if ( bRet )
  509. {
  510. if ( ISBYREF( 2 ) )
  511. hb_storclen( ( char * ) lpszCurrentDirectory, ( ULONG ) dwCurrentDirectory, 2 ) ;
  512. }
  513. hb_xfree( lpszCurrentDirectory ) ;
  514. }
  515. //---------------------------------------------------------------------//
  516. /*
  517. BOOL FtpSetCurrentDirectory(
  518. IN HINTERNET hConnect,
  519. IN LPCTSTR lpszDirectory
  520. );
  521. */
  522. //
  523. // if FtpSetCurrentDirectory( hInternet, cDirectory )
  524. // ? 'Success'
  525. // endif
  526. //
  527. HB_FUNC( FTPSETCURRENTDIRECTORY )
  528. {
  529. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  530. LPTSTR lpszDirectory = hb_parcx( 2 ) ;
  531. hb_retl( FtpSetCurrentDirectoryA( hInternet, lpszDirectory ) ) ;
  532. }
  533. //---------------------------------------------------------------------//
  534. /*
  535. BOOL InternetCloseHandle(
  536. IN HINTERNET hInternet
  537. );
  538. */
  539. //
  540. // if InternetCloseHandle( hInternet )
  541. // ? 'Success'
  542. // endif
  543. //
  544. HB_FUNC( INTERNETCLOSEHANDLE )
  545. {
  546. HINTERNET hInternet = ( HINTERNET ) hb_parnl( 1 ) ;
  547. hb_retl( InternetCloseHandle( hInternet ) ) ;
  548. }
  549. //---------------------------------------------------------------------//
  550. /*
  551. DWORD InternetAttemptConnect(
  552. IN DWORD dwReserved
  553. );
  554. */
  555. //
  556. // InternetAttempConnect()
  557. //
  558. HB_FUNC( INTERNETATTEMPTCONNECT )
  559. {
  560. DWORD dwReserved = 0 ;
  561. hb_retnl( ( ULONG ) InternetAttemptConnect( dwReserved ) ) ;
  562. }
  563. //---------------------------------------------------------------------//
  564. #endif
  565. #endif