Skip to content

Commit 9da5bdb

Browse files
authored
Fix and complete httpapi (#806)
* fix httplib library dependency and wrong parameter type of HttpCreateHttpHandle * httpapi: add missing functions: HttpDeclarePush,HttpUpdateServiceConfiguration * httpapi: add missing macro: HTTP_IS_NULL_ID,HTTP_SET_NULL_ID
1 parent 75936f2 commit 9da5bdb

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ const DATA: &'static [(&'static str, &'static [&'static str], &'static [&'static
214214
("handleapi", &["minwindef", "winnt"], &["kernel32"]),
215215
("heapapi", &["basetsd", "minwinbase", "minwindef", "winnt"], &["kernel32"]),
216216
("highlevelmonitorconfigurationapi", &["minwindef", "physicalmonitorenumerationapi", "winnt"], &["dxva2"]),
217-
("http", &["guiddef", "minwinbase", "minwindef", "sspi", "winnt", "ws2def"], &["winhttp"]),
217+
("http", &["guiddef", "minwinbase", "minwindef", "sspi", "winnt", "ws2def"], &["httpapi"]),
218218
("imm", &["minwindef", "windef"], &["imm32"]),
219219
("interlockedapi", &["minwindef", "winnt"], &["kernel32"]),
220220
("ioapiset", &["basetsd", "minwinbase", "minwindef", "winnt"], &["kernel32"]),

src/um/http.rs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,15 @@ STRUCT!{struct HTTP_SERVICE_CONFIG_CACHE_SET {
840840
ParamDesc: HTTP_SERVICE_CONFIG_CACHE_PARAM,
841841
}}
842842
pub type PHTTP_SERVICE_CONFIG_CACHE_SET = *mut HTTP_SERVICE_CONFIG_CACHE_SET;
843+
pub const HTTP_NULL_ID: ULONGLONG = 0;
844+
#[inline]
845+
pub unsafe fn HTTP_IS_NULL_ID(pid: PHTTP_OPAQUE_ID) -> bool {
846+
HTTP_NULL_ID == *pid
847+
}
848+
#[inline]
849+
pub unsafe fn HTTP_SET_NULL_ID(pid: PHTTP_OPAQUE_ID) {
850+
*pid = HTTP_NULL_ID
851+
}
843852
extern "system" {
844853
pub fn HttpInitialize(
845854
Version: HTTPAPI_VERSION,
@@ -851,7 +860,7 @@ extern "system" {
851860
pReserved: PVOID,
852861
) -> ULONG;
853862
pub fn HttpCreateHttpHandle(
854-
pReqQueueHandle: HANDLE,
863+
pReqQueueHandle: PHANDLE,
855864
Reserved: ULONG,
856865
) -> ULONG;
857866
pub fn HttpCreateRequestQueue(
@@ -1069,4 +1078,19 @@ extern "system" {
10691078
pReturnLength: PULONG,
10701079
pOverlapped: LPOVERLAPPED,
10711080
) -> ULONG;
1081+
pub fn HttpDeclarePush(
1082+
RequestQueueHandle: HANDLE,
1083+
RequestId: HTTP_REQUEST_ID,
1084+
Verb: HTTP_VERB,
1085+
Path: PCWSTR,
1086+
Query: PCSTR,
1087+
Headers: PHTTP_REQUEST_HEADERS,
1088+
) -> ULONG;
1089+
pub fn HttpUpdateServiceConfiguration(
1090+
Handle: HANDLE,
1091+
ConfigId: HTTP_SERVICE_CONFIG_ID,
1092+
ConfigInfo: PVOID,
1093+
ConfigInfoLength: ULONG,
1094+
Overlapped: LPOVERLAPPED,
1095+
) -> ULONG;
10721096
}

0 commit comments

Comments
 (0)