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