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
220191ab
Commit
220191ab
authored
Sep 04, 2011
by
André Hentschel
Committed by
Alexandre Julliard
Sep 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptnet: Use the constants from the wininet header.
parent
31f0f09a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
12 deletions
+29
-12
cryptnet_main.c
dlls/cryptnet/cryptnet_main.c
+29
-12
No files found.
dlls/cryptnet/cryptnet_main.c
View file @
220191ab
...
...
@@ -583,16 +583,25 @@ static BOOL CRYPT_CrackUrl(LPCWSTR pszURL, URL_COMPONENTSW *components)
memset
(
components
,
0
,
sizeof
(
*
components
));
components
->
dwStructSize
=
sizeof
(
*
components
);
components
->
lpszHostName
=
CryptMemAlloc
(
MAX_PATH
*
sizeof
(
WCHAR
));
components
->
dwHostNameLength
=
MAX_PATH
;
components
->
lpszUrlPath
=
CryptMemAlloc
(
MAX_PATH
*
2
*
sizeof
(
WCHAR
));
components
->
dwUrlPathLength
=
2
*
MAX_PATH
;
components
->
lpszHostName
=
CryptMemAlloc
(
INTERNET_MAX_HOST_NAME_LENGTH
*
sizeof
(
WCHAR
));
components
->
dwHostNameLength
=
INTERNET_MAX_HOST_NAME_LENGTH
;
if
(
!
components
->
lpszHostName
)
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
components
->
lpszUrlPath
=
CryptMemAlloc
(
INTERNET_MAX_PATH_LENGTH
*
sizeof
(
WCHAR
));
components
->
dwUrlPathLength
=
INTERNET_MAX_PATH_LENGTH
;
if
(
!
components
->
lpszUrlPath
)
{
CryptMemFree
(
components
->
lpszHostName
);
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
ret
=
InternetCrackUrlW
(
pszURL
,
0
,
ICU_DECODE
,
components
);
if
(
ret
)
{
if
((
components
->
dwUrlPathLength
==
2
*
MAX_PATH
-
1
)
||
(
components
->
dwHostNameLength
==
MAX_PATH
-
1
))
FIXME
(
"Buffers are too small
\n
"
);
switch
(
components
->
nScheme
)
{
case
INTERNET_SCHEME_FTP
:
...
...
@@ -1025,16 +1034,19 @@ static BOOL WINAPI File_RetrieveEncodedObjectW(LPCWSTR pszURL,
*
ppfnFreeObject
=
CRYPT_FreeBlob
;
*
ppvFreeContext
=
NULL
;
components
.
lpszUrlPath
=
CryptMemAlloc
(
MAX_PATH
*
2
*
sizeof
(
WCHAR
));
components
.
dwUrlPathLength
=
2
*
MAX_PATH
;
components
.
lpszUrlPath
=
CryptMemAlloc
(
INTERNET_MAX_PATH_LENGTH
*
sizeof
(
WCHAR
));
components
.
dwUrlPathLength
=
INTERNET_MAX_PATH_LENGTH
;
if
(
!
components
.
lpszUrlPath
)
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
ret
=
InternetCrackUrlW
(
pszURL
,
0
,
ICU_DECODE
,
&
components
);
if
(
ret
)
{
LPWSTR
path
;
if
(
components
.
dwUrlPathLength
==
2
*
MAX_PATH
-
1
)
FIXME
(
"Buffers are too small
\n
"
);
/* 3 == lstrlenW(L"c:") + 1 */
path
=
CryptMemAlloc
((
components
.
dwUrlPathLength
+
3
)
*
sizeof
(
WCHAR
));
if
(
path
)
...
...
@@ -1087,6 +1099,11 @@ static BOOL WINAPI File_RetrieveEncodedObjectW(LPCWSTR pszURL,
ret
=
FALSE
;
CryptMemFree
(
path
);
}
else
{
SetLastError
(
ERROR_OUTOFMEMORY
);
ret
=
FALSE
;
}
}
CryptMemFree
(
components
.
lpszUrlPath
);
return
ret
;
...
...
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