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(
...
@@ -3154,13 +3154,9 @@ BOOL WINAPI ReadUrlCacheEntryStream(
* RetrieveUrlCacheEntryStreamA (WININET.@)
* RetrieveUrlCacheEntryStreamA (WININET.@)
*
*
*/
*/
HANDLE
WINAPI
RetrieveUrlCacheEntryStreamA
(
HANDLE
WINAPI
RetrieveUrlCacheEntryStreamA
(
LPCSTR
lpszUrlName
,
IN
LPCSTR
lpszUrlName
,
LPINTERNET_CACHE_ENTRY_INFOA
lpCacheEntryInfo
,
OUT
LPINTERNET_CACHE_ENTRY_INFOA
lpCacheEntryInfo
,
LPDWORD
lpdwCacheEntryInfoBufferSize
,
BOOL
fRandomRead
,
DWORD
dwReserved
)
IN
OUT
LPDWORD
lpdwCacheEntryInfoBufferSize
,
IN
BOOL
fRandomRead
,
IN
DWORD
dwReserved
)
{
{
/* NOTE: this is not the same as the way that the native
/* NOTE: this is not the same as the way that the native
* version allocates 'stream' handles. I did it this way
* version allocates 'stream' handles. I did it this way
...
@@ -3168,103 +3164,89 @@ HANDLE WINAPI RetrieveUrlCacheEntryStreamA(
...
@@ -3168,103 +3164,89 @@ HANDLE WINAPI RetrieveUrlCacheEntryStreamA(
* on this behaviour. (Native version appears to allocate
* on this behaviour. (Native version appears to allocate
* indices into a table)
* indices into a table)
*/
*/
stream_handle
*
pS
tream
;
stream_handle
*
s
tream
;
HANDLE
hF
ile
;
HANDLE
f
ile
;
TRACE
(
"(%s, %p, %p, %x, 0x%08x)
\n
"
,
debugstr_a
(
lpszUrlName
),
lpCacheEntryInfo
,
TRACE
(
"(%s, %p, %p, %x, 0x%08x)
\n
"
,
debugstr_a
(
lpszUrlName
),
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
fRandomRead
,
dwReserved
);
lpdwCacheEntryInfoBufferSize
,
fRandomRead
,
dwReserved
);
if
(
!
RetrieveUrlCacheEntryFileA
(
lpszUrlName
,
if
(
!
RetrieveUrlCacheEntryFileA
(
lpszUrlName
,
lpCacheEntryInfo
,
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
dwReserved
))
lpdwCacheEntryInfoBufferSize
,
return
NULL
;
dwReserved
))
{
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
;
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 */
/* allocate handle storage space */
pS
tream
=
heap_alloc
(
sizeof
(
stream_handle
)
+
strlen
(
lpszUrlName
)
*
sizeof
(
CHAR
));
s
tream
=
heap_alloc
(
sizeof
(
stream_handle
)
+
strlen
(
lpszUrlName
)
*
sizeof
(
CHAR
));
if
(
!
pStream
)
if
(
!
stream
)
{
{
CloseHandle
(
file
);
CloseHandle
(
hFile
);
UnlockUrlCacheEntryFileA
(
lpszUrlName
,
0
);
SetLastError
(
ERROR_OUTOFMEMORY
);
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
return
NULL
;
}
}
pStream
->
file
=
hF
ile
;
stream
->
file
=
f
ile
;
strcpy
(
pS
tream
->
url
,
lpszUrlName
);
strcpy
(
s
tream
->
url
,
lpszUrlName
);
return
pS
tream
;
return
s
tream
;
}
}
/***********************************************************************
/***********************************************************************
* RetrieveUrlCacheEntryStreamW (WININET.@)
* RetrieveUrlCacheEntryStreamW (WININET.@)
*
*
*/
*/
HANDLE
WINAPI
RetrieveUrlCacheEntryStreamW
(
HANDLE
WINAPI
RetrieveUrlCacheEntryStreamW
(
LPCWSTR
lpszUrlName
,
IN
LPCWSTR
lpszUrlName
,
LPINTERNET_CACHE_ENTRY_INFOW
lpCacheEntryInfo
,
OUT
LPINTERNET_CACHE_ENTRY_INFOW
lpCacheEntryInfo
,
LPDWORD
lpdwCacheEntryInfoBufferSize
,
BOOL
fRandomRead
,
DWORD
dwReserved
)
IN
OUT
LPDWORD
lpdwCacheEntryInfoBufferSize
,
IN
BOOL
fRandomRead
,
IN
DWORD
dwReserved
)
{
{
DWORD
size
;
DWORD
len
;
int
url_len
;
/* NOTE: this is not the same as the way that the native
/* NOTE: this is not the same as the way that the native
* version allocates 'stream' handles. I did it this way
* version allocates 'stream' handles. I did it this way
* as it is much easier and no applications should depend
* as it is much easier and no applications should depend
* on this behaviour. (Native version appears to allocate
* on this behaviour. (Native version appears to allocate
* indices into a table)
* indices into a table)
*/
*/
stream_handle
*
pS
tream
;
stream_handle
*
s
tream
;
HANDLE
hF
ile
;
HANDLE
f
ile
;
TRACE
(
"(%s, %p, %p, %x, 0x%08x)
\n
"
,
debugstr_w
(
lpszUrlName
),
lpCacheEntryInfo
,
TRACE
(
"(%s, %p, %p, %x, 0x%08x)
\n
"
,
debugstr_w
(
lpszUrlName
),
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
fRandomRead
,
dwReserved
);
lpdwCacheEntryInfoBufferSize
,
fRandomRead
,
dwReserved
);
if
(
!
RetrieveUrlCacheEntryFileW
(
lpszUrlName
,
if
(
!
(
len
=
urlcache_encode_url
(
lpszUrlName
,
NULL
,
0
)))
lpCacheEntryInfo
,
lpdwCacheEntryInfoBufferSize
,
dwReserved
))
{
return
NULL
;
return
NULL
;
}
hFile
=
CreateFileW
(
lpCacheEntryInfo
->
lpszLocalFileName
,
if
(
!
RetrieveUrlCacheEntryFileW
(
lpszUrlName
,
lpCacheEntryInfo
,
GENERIC_READ
,
lpdwCacheEntryInfoBufferSize
,
dwReserved
))
FILE_SHARE_READ
,
return
NULL
;
NULL
,
OPEN_EXISTING
,
file
=
CreateFileW
(
lpCacheEntryInfo
->
lpszLocalFileName
,
GENERIC_READ
,
FILE_SHARE_READ
,
fRandomRead
?
FILE_FLAG_RANDOM_ACCESS
:
0
,
NULL
,
OPEN_EXISTING
,
fRandomRead
?
FILE_FLAG_RANDOM_ACCESS
:
0
,
NULL
);
NULL
);
if
(
file
==
INVALID_HANDLE_VALUE
)
{
if
(
hFile
==
INVALID_HANDLE_VALUE
)
UnlockUrlCacheEntryFileW
(
lpszUrlName
,
0
);
return
FALSE
;
return
NULL
;
}
/* allocate handle storage space */
/* allocate handle storage space */
size
=
sizeof
(
stream_handle
);
stream
=
heap_alloc
(
sizeof
(
stream_handle
)
+
len
*
sizeof
(
WCHAR
));
url_len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpszUrlName
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
stream
)
{
size
+=
url_len
;
CloseHandle
(
file
);
pStream
=
heap_alloc
(
size
);
UnlockUrlCacheEntryFileW
(
lpszUrlName
,
0
);
if
(
!
pStream
)
{
CloseHandle
(
hFile
);
SetLastError
(
ERROR_OUTOFMEMORY
);
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
return
NULL
;
}
}
pStream
->
file
=
hFile
;
stream
->
file
=
file
;
WideCharToMultiByte
(
CP_ACP
,
0
,
lpszUrlName
,
-
1
,
pStream
->
url
,
url_len
,
NULL
,
NULL
);
if
(
!
urlcache_encode_url
(
lpszUrlName
,
stream
->
url
,
len
))
{
return
pStream
;
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