Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d39dc980
Commit
d39dc980
authored
Aug 26, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http.sys: Fill out the cooked URL.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d5ec9fa7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
1 deletion
+69
-1
http.c
dlls/http.sys/http.c
+69
-1
No files found.
dlls/http.sys/http.c
View file @
d39dc980
...
...
@@ -266,12 +266,14 @@ static int parse_token(const char *str, const char *end)
static
NTSTATUS
complete_irp
(
struct
connection
*
conn
,
IRP
*
irp
)
{
static
const
WCHAR
httpW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
};
const
struct
http_receive_request_params
params
=
*
(
struct
http_receive_request_params
*
)
irp
->
AssociatedIrp
.
SystemBuffer
;
DWORD
irp_size
=
(
params
.
bits
==
32
)
?
sizeof
(
struct
http_request_32
)
:
sizeof
(
struct
http_request_64
);
IO_STACK_LOCATION
*
stack
=
IoGetCurrentIrpStackLocation
(
irp
);
const
DWORD
output_len
=
stack
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
;
ULONG
offset
;
ULONG
cooked_len
,
host_len
,
abs_path_len
,
query_len
,
offset
;
const
char
*
p
,
*
host
,
*
abs_path
,
*
query
;
TRACE
(
"Completing IRP %p.
\n
"
,
irp
);
...
...
@@ -281,6 +283,32 @@ static NTSTATUS complete_irp(struct connection *conn, IRP *irp)
irp_size
+=
conn
->
unk_verb_len
+
1
;
irp_size
+=
conn
->
url_len
+
1
;
/* cooked URL */
if
(
conn
->
url
[
0
]
==
'/'
)
{
p
=
host
=
conn
->
host
;
while
(
isgraph
(
*
p
))
++
p
;
host_len
=
p
-
conn
->
host
;
abs_path
=
conn
->
url
;
abs_path_len
=
conn
->
url_len
;
}
else
{
host
=
conn
->
url
+
7
;
abs_path
=
strchr
(
host
,
'/'
);
host_len
=
abs_path
-
host
;
abs_path_len
=
(
conn
->
url
+
conn
->
url_len
)
-
abs_path
;
}
if
((
query
=
memchr
(
abs_path
,
'?'
,
abs_path_len
)))
{
query_len
=
(
abs_path
+
abs_path_len
)
-
query
;
abs_path_len
=
query
-
abs_path
;
}
else
query_len
=
0
;
cooked_len
=
(
7
/* scheme */
+
host_len
+
abs_path_len
+
query_len
)
*
sizeof
(
WCHAR
);
irp_size
+=
cooked_len
+
sizeof
(
WCHAR
);
TRACE
(
"Need %u bytes, have %u.
\n
"
,
irp_size
,
output_len
);
irp
->
IoStatus
.
Information
=
irp_size
;
...
...
@@ -328,6 +356,26 @@ static NTSTATUS complete_irp(struct connection *conn, IRP *irp)
offset
+=
conn
->
url_len
;
buffer
[
offset
++
]
=
0
;
req
->
CookedUrl
.
FullUrlLength
=
cooked_len
;
req
->
CookedUrl
.
HostLength
=
host_len
*
sizeof
(
WCHAR
);
req
->
CookedUrl
.
AbsPathLength
=
abs_path_len
*
sizeof
(
WCHAR
);
req
->
CookedUrl
.
QueryStringLength
=
query_len
*
sizeof
(
WCHAR
);
req
->
CookedUrl
.
pFullUrl
=
params
.
addr
+
offset
;
req
->
CookedUrl
.
pHost
=
req
->
CookedUrl
.
pFullUrl
+
7
*
sizeof
(
WCHAR
);
req
->
CookedUrl
.
pAbsPath
=
req
->
CookedUrl
.
pHost
+
host_len
*
sizeof
(
WCHAR
);
if
(
query
)
req
->
CookedUrl
.
pQueryString
=
req
->
CookedUrl
.
pAbsPath
+
abs_path_len
*
sizeof
(
WCHAR
);
memcpy
(
buffer
+
offset
,
httpW
,
sizeof
(
httpW
));
offset
+=
7
*
sizeof
(
WCHAR
);
MultiByteToWideChar
(
CP_ACP
,
0
,
host
,
host_len
,
(
WCHAR
*
)(
buffer
+
offset
),
host_len
*
sizeof
(
WCHAR
));
offset
+=
host_len
*
sizeof
(
WCHAR
);
MultiByteToWideChar
(
CP_ACP
,
0
,
abs_path
,
abs_path_len
+
query_len
,
(
WCHAR
*
)(
buffer
+
offset
),
(
abs_path_len
+
query_len
)
*
sizeof
(
WCHAR
));
offset
+=
(
abs_path_len
+
query_len
)
*
sizeof
(
WCHAR
);
buffer
[
offset
++
]
=
0
;
buffer
[
offset
++
]
=
0
;
req
->
BytesReceived
=
conn
->
req_len
;
}
else
...
...
@@ -357,6 +405,26 @@ static NTSTATUS complete_irp(struct connection *conn, IRP *irp)
offset
+=
conn
->
url_len
;
buffer
[
offset
++
]
=
0
;
req
->
CookedUrl
.
FullUrlLength
=
cooked_len
;
req
->
CookedUrl
.
HostLength
=
host_len
*
sizeof
(
WCHAR
);
req
->
CookedUrl
.
AbsPathLength
=
abs_path_len
*
sizeof
(
WCHAR
);
req
->
CookedUrl
.
QueryStringLength
=
query_len
*
sizeof
(
WCHAR
);
req
->
CookedUrl
.
pFullUrl
=
params
.
addr
+
offset
;
req
->
CookedUrl
.
pHost
=
req
->
CookedUrl
.
pFullUrl
+
7
*
sizeof
(
WCHAR
);
req
->
CookedUrl
.
pAbsPath
=
req
->
CookedUrl
.
pHost
+
host_len
*
sizeof
(
WCHAR
);
if
(
query
)
req
->
CookedUrl
.
pQueryString
=
req
->
CookedUrl
.
pAbsPath
+
abs_path_len
*
sizeof
(
WCHAR
);
memcpy
(
buffer
+
offset
,
httpW
,
sizeof
(
httpW
));
offset
+=
7
*
sizeof
(
WCHAR
);
MultiByteToWideChar
(
CP_ACP
,
0
,
host
,
host_len
,
(
WCHAR
*
)(
buffer
+
offset
),
host_len
*
sizeof
(
WCHAR
));
offset
+=
host_len
*
sizeof
(
WCHAR
);
MultiByteToWideChar
(
CP_ACP
,
0
,
abs_path
,
abs_path_len
+
query_len
,
(
WCHAR
*
)(
buffer
+
offset
),
(
abs_path_len
+
query_len
)
*
sizeof
(
WCHAR
));
offset
+=
(
abs_path_len
+
query_len
)
*
sizeof
(
WCHAR
);
buffer
[
offset
++
]
=
0
;
buffer
[
offset
++
]
=
0
;
req
->
BytesReceived
=
conn
->
req_len
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment