-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWinHttp.pas
71 lines (54 loc) · 3.27 KB
/
WinHttp.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
unit
WinHttp;
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
interface
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
const
WINHTTP_DLL = 'WINHTTP.DLL';
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
const
WINHTTP_ACCESS_TYPE_NO_PROXY = 1;
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY = 0;
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
const
WINHTTP_FLAG_SECURE = $800000;
WINHTTP_FLAG_BYPASS_PROXY_CACHE = $100;
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
const
WINHTTP_OPTION_DISABLE_FEATURE = $3F;
WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL = $85;
WINHTTP_DISABLE_KEEP_ALIVE = $08;
WINHTTP_PROTOCOL_FLAG_HTTP2 = $01;
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
function WinHttpOpen(pwszUserAgent: PWideChar; dwAccessType: Cardinal; pwszProxyName, pwszProxyBypass: PWideChar; dwFlags: Cardinal): Pointer; stdcall; external WINHTTP_DLL;
function WinHttpConnect(hInternet: Pointer; pswzServerName: PWideChar; nServerPort: Word; dwReserved: Cardinal): Pointer; stdcall; external WINHTTP_DLL;
function WinHttpOpenRequest(hInternet: Pointer; pwszVerb: PWideChar; pwszObjectName: PWideChar; pwszVersion: PWideChar; pwszReferer: PWideChar; ppwszAcceptTypes: PWideChar; dwFlags: Cardinal): Pointer; stdcall; external WINHTTP_DLL;
function WinHttpSetOption(hInternet: Pointer; dwOption: Cardinal; lpBuffer: Pointer; dwBufferLength: Cardinal): Boolean; stdcall; external WINHTTP_DLL;
function WinHttpQueryOption(hInternet: Pointer; dwOption: Cardinal; var lpBuffer: Pointer; var lpdwBufferLength: Cardinal): Boolean; stdcall; external WINHTTP_DLL;
function WinHttpSendRequest(hInternet: Pointer; pwszHeaders: PWideChar; dwHeadersLength: Cardinal; lpOptional: Pointer; dwOptionalLength: Cardinal; dwTotalLength: Cardinal; dwContext: Cardinal): Boolean; stdcall; external WINHTTP_DLL;
function WinHttpReceiveResponse(hInternet: Pointer; lpReserved: Pointer): Boolean; stdcall; external WINHTTP_DLL;
function WinHttpReadData(hInternet: Pointer; lpBuffer: Pointer; dwNumberOfBytesToRead: Cardinal; var lpdwNumberOfBytesRead: Cardinal): Boolean; stdcall; external WINHTTP_DLL;
function WinHttpCloseHandle(hInternet: Pointer): Boolean; stdcall; external WINHTTP_DLL;
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
implementation
// --------------------------------------------------------------------------
//
// --------------------------------------------------------------------------
end.