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
a56fbf33
Commit
a56fbf33
authored
Apr 01, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 01, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Support Punycode in RetrieveUrlCacheEntryStream.
parent
c5346085
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
73 deletions
+55
-73
urlcache.c
dlls/wininet/urlcache.c
+55
-73
No files found.
dlls/wininet/urlcache.c
View file @
a56fbf33
...
...
@@ -3154,13 +3154,9 @@ BOOL WINAPI ReadUrlCacheEntryStream(
* RetrieveUrlCacheEntryStreamA (WININET.@)
*
*/
HANDLE
WINAPI
RetrieveUrlCacheEntryStreamA
(
IN
LPCSTR
lpszUrlName
,
OUT
LPINTERNET_CACHE_ENTRY_INFOA
lpCacheEntryInfo
,
IN
OUT
LPDWORD
lpdwCacheEntryInfoBufferSize
,
IN
BOOL
fRandomRead
,
IN
DWORD
dwReserved
)
HANDLE
WINAPI
RetrieveUrlCacheEntryStreamA
(
LPCSTR
lpszUrlName
,
LPINTERNET_CACHE_ENTRY_INFOA
lpCacheEntryInfo
,
LPDWORD
lpdwCacheEntryInfoBufferSize
,
BOOL
fRandomRead
,
DWORD
dwReserved
)
{
/* NOTE: this is not the same as the way that the native
* version allocates 'stream' handles. I did it this way
...
...
@@ -3168,103 +3164,89 @@ HANDLE WINAPI RetrieveUrlCacheEntryStreamA(
* on this behaviour. (Native version appears to allocate
* indices into a table)
*/
stream_handle
*
pS
tream
;
HANDLE
hF
ile
;
stream_handle
*
s
tream
;
HANDLE
f
ile
;
TRACE
(
"(%s, %p, %p, %x, 0x%08x)
\n
"
,
debugstr_a
(
lpszUrlName
),
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
fRandomRead
,
dwReserved
);
TRACE
(
"(%s, %p, %p, %x, 0x%08x)
\n
"
,
debugstr_a
(
lpszUrlName
),
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
fRandomRead
,
dwReserved
);
if
(
!
RetrieveUrlCacheEntryFileA
(
lpszUrlName
,
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
dwReserved
))
{
if
(
!
RetrieveUrlCacheEntryFileA
(
lpszUrlName
,
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
dwReserved
))
return
NULL
;
file
=
CreateFileA
(
lpCacheEntryInfo
->
lpszLocalFileName
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
fRandomRead
?
FILE_FLAG_RANDOM_ACCESS
:
0
,
NULL
);
if
(
file
==
INVALID_HANDLE_VALUE
)
{
UnlockUrlCacheEntryFileA
(
lpszUrlName
,
0
);
return
NULL
;
}
hFile
=
CreateFileA
(
lpCacheEntryInfo
->
lpszLocalFileName
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
fRandomRead
?
FILE_FLAG_RANDOM_ACCESS
:
0
,
NULL
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
/* allocate handle storage space */
pS
tream
=
heap_alloc
(
sizeof
(
stream_handle
)
+
strlen
(
lpszUrlName
)
*
sizeof
(
CHAR
));
if
(
!
pStream
)
{
CloseHandle
(
hFile
);
s
tream
=
heap_alloc
(
sizeof
(
stream_handle
)
+
strlen
(
lpszUrlName
)
*
sizeof
(
CHAR
));
if
(
!
stream
)
{
CloseHandle
(
file
);
UnlockUrlCacheEntryFileA
(
lpszUrlName
,
0
);
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
return
NULL
;
}
pStream
->
file
=
hF
ile
;
strcpy
(
pS
tream
->
url
,
lpszUrlName
);
return
pS
tream
;
stream
->
file
=
f
ile
;
strcpy
(
s
tream
->
url
,
lpszUrlName
);
return
s
tream
;
}
/***********************************************************************
* RetrieveUrlCacheEntryStreamW (WININET.@)
*
*/
HANDLE
WINAPI
RetrieveUrlCacheEntryStreamW
(
IN
LPCWSTR
lpszUrlName
,
OUT
LPINTERNET_CACHE_ENTRY_INFOW
lpCacheEntryInfo
,
IN
OUT
LPDWORD
lpdwCacheEntryInfoBufferSize
,
IN
BOOL
fRandomRead
,
IN
DWORD
dwReserved
)
HANDLE
WINAPI
RetrieveUrlCacheEntryStreamW
(
LPCWSTR
lpszUrlName
,
LPINTERNET_CACHE_ENTRY_INFOW
lpCacheEntryInfo
,
LPDWORD
lpdwCacheEntryInfoBufferSize
,
BOOL
fRandomRead
,
DWORD
dwReserved
)
{
DWORD
size
;
int
url_len
;
DWORD
len
;
/* NOTE: this is not the same as the way that the native
* version allocates 'stream' handles. I did it this way
* as it is much easier and no applications should depend
* on this behaviour. (Native version appears to allocate
* indices into a table)
*/
stream_handle
*
pS
tream
;
HANDLE
hF
ile
;
stream_handle
*
s
tream
;
HANDLE
f
ile
;
TRACE
(
"(%s, %p, %p, %x, 0x%08x)
\n
"
,
debugstr_w
(
lpszUrlName
),
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
fRandomRead
,
dwReserved
);
TRACE
(
"(%s, %p, %p, %x, 0x%08x)
\n
"
,
debugstr_w
(
lpszUrlName
),
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
fRandomRead
,
dwReserved
);
if
(
!
RetrieveUrlCacheEntryFileW
(
lpszUrlName
,
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
dwReserved
))
{
if
(
!
(
len
=
urlcache_encode_url
(
lpszUrlName
,
NULL
,
0
)))
return
NULL
;
}
hFile
=
CreateFileW
(
lpCacheEntryInfo
->
lpszLocalFileName
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
fRandomRead
?
FILE_FLAG_RANDOM_ACCESS
:
0
,
NULL
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
if
(
!
RetrieveUrlCacheEntryFileW
(
lpszUrlName
,
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
dwReserved
))
return
NULL
;
file
=
CreateFileW
(
lpCacheEntryInfo
->
lpszLocalFileName
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
fRandomRead
?
FILE_FLAG_RANDOM_ACCESS
:
0
,
NULL
);
if
(
file
==
INVALID_HANDLE_VALUE
)
{
UnlockUrlCacheEntryFileW
(
lpszUrlName
,
0
);
return
NULL
;
}
/* allocate handle storage space */
size
=
sizeof
(
stream_handle
);
url_len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpszUrlName
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
size
+=
url_len
;
pStream
=
heap_alloc
(
size
);
if
(
!
pStream
)
{
CloseHandle
(
hFile
);
stream
=
heap_alloc
(
sizeof
(
stream_handle
)
+
len
*
sizeof
(
WCHAR
));
if
(
!
stream
)
{
CloseHandle
(
file
);
UnlockUrlCacheEntryFileW
(
lpszUrlName
,
0
);
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
return
NULL
;
}
pStream
->
file
=
hFile
;
WideCharToMultiByte
(
CP_ACP
,
0
,
lpszUrlName
,
-
1
,
pStream
->
url
,
url_len
,
NULL
,
NULL
);
return
pStream
;
stream
->
file
=
file
;
if
(
!
urlcache_encode_url
(
lpszUrlName
,
stream
->
url
,
len
))
{
CloseHandle
(
file
);
UnlockUrlCacheEntryFileW
(
lpszUrlName
,
0
);
heap_free
(
stream
);
return
NULL
;
}
return
stream
;
}
/***********************************************************************
...
...
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