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
dd44930b
Commit
dd44930b
authored
Jul 10, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Use nameless unions/structs.
parent
26826d3a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
39 deletions
+31
-39
binding.c
dlls/urlmon/binding.c
+8
-10
http.c
dlls/urlmon/http.c
+3
-5
urlmon_main.c
dlls/urlmon/urlmon_main.c
+15
-17
usrmarshal.c
dlls/urlmon/usrmarshal.c
+5
-7
No files found.
dlls/urlmon/binding.c
View file @
dd44930b
...
...
@@ -16,8 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#include "urlmon_main.h"
#include "winreg.h"
#include "shlwapi.h"
...
...
@@ -143,7 +141,7 @@ static void dump_BINDINFO(BINDINFO *bi)
"}
\n
"
,
bi
->
cbSize
,
debugstr_w
(
bi
->
szExtraInfo
),
bi
->
stgmedData
.
tymed
,
bi
->
stgmedData
.
u
.
hGlobal
,
bi
->
stgmedData
.
pUnkForRelease
,
bi
->
stgmedData
.
tymed
,
bi
->
stgmedData
.
hGlobal
,
bi
->
stgmedData
.
pUnkForRelease
,
bi
->
grfBindInfoF
>
BINDINFOF_URLENCODEDEXTRAINFO
?
"unknown"
:
BINDINFOF_str
[
bi
->
grfBindInfoF
],
bi
->
dwBindVerb
>
BINDVERB_CUSTOM
...
...
@@ -522,7 +520,7 @@ static HRESULT WINAPI ProtocolStream_Seek(IStream *iface, LARGE_INTEGER dlibMove
LARGE_INTEGER
new_pos
;
DWORD
method
;
TRACE
(
"(%p)->(%ld %08lx %p)
\n
"
,
This
,
dlibMove
.
u
.
LowPart
,
dwOrigin
,
plibNewPosition
);
TRACE
(
"(%p)->(%ld %08lx %p)
\n
"
,
This
,
dlibMove
.
LowPart
,
dwOrigin
,
plibNewPosition
);
if
(
This
->
buf
->
file
==
INVALID_HANDLE_VALUE
)
{
/* We should probably call protocol handler's Seek. */
...
...
@@ -558,7 +556,7 @@ static HRESULT WINAPI ProtocolStream_Seek(IStream *iface, LARGE_INTEGER dlibMove
static
HRESULT
WINAPI
ProtocolStream_SetSize
(
IStream
*
iface
,
ULARGE_INTEGER
libNewSize
)
{
ProtocolStream
*
This
=
impl_from_IStream
(
iface
);
FIXME
(
"(%p)->(%ld)
\n
"
,
This
,
libNewSize
.
u
.
LowPart
);
FIXME
(
"(%p)->(%ld)
\n
"
,
This
,
libNewSize
.
LowPart
);
return
E_NOTIMPL
;
}
...
...
@@ -566,7 +564,7 @@ static HRESULT WINAPI ProtocolStream_CopyTo(IStream *iface, IStream *pstm,
ULARGE_INTEGER
cb
,
ULARGE_INTEGER
*
pcbRead
,
ULARGE_INTEGER
*
pcbWritten
)
{
ProtocolStream
*
This
=
impl_from_IStream
(
iface
);
FIXME
(
"(%p)->(%p %ld %p %p)
\n
"
,
This
,
pstm
,
cb
.
u
.
LowPart
,
pcbRead
,
pcbWritten
);
FIXME
(
"(%p)->(%p %ld %p %p)
\n
"
,
This
,
pstm
,
cb
.
LowPart
,
pcbRead
,
pcbWritten
);
return
E_NOTIMPL
;
}
...
...
@@ -592,7 +590,7 @@ static HRESULT WINAPI ProtocolStream_LockRegion(IStream *iface, ULARGE_INTEGER l
ULARGE_INTEGER
cb
,
DWORD
dwLockType
)
{
ProtocolStream
*
This
=
impl_from_IStream
(
iface
);
FIXME
(
"(%p)->(%ld %ld %ld)
\n
"
,
This
,
libOffset
.
u
.
LowPart
,
cb
.
u
.
LowPart
,
dwLockType
);
FIXME
(
"(%p)->(%ld %ld %ld)
\n
"
,
This
,
libOffset
.
LowPart
,
cb
.
LowPart
,
dwLockType
);
return
E_NOTIMPL
;
}
...
...
@@ -600,7 +598,7 @@ static HRESULT WINAPI ProtocolStream_UnlockRegion(IStream *iface,
ULARGE_INTEGER
libOffset
,
ULARGE_INTEGER
cb
,
DWORD
dwLockType
)
{
ProtocolStream
*
This
=
impl_from_IStream
(
iface
);
FIXME
(
"(%p)->(%ld %ld %ld)
\n
"
,
This
,
libOffset
.
u
.
LowPart
,
cb
.
u
.
LowPart
,
dwLockType
);
FIXME
(
"(%p)->(%ld %ld %ld)
\n
"
,
This
,
libOffset
.
LowPart
,
cb
.
LowPart
,
dwLockType
);
return
E_NOTIMPL
;
}
...
...
@@ -669,7 +667,7 @@ static HRESULT stgmed_stream_fill_stgmed(stgmed_obj_t *obj, STGMEDIUM *stgmed)
ProtocolStream
*
stream
=
(
ProtocolStream
*
)
obj
;
stgmed
->
tymed
=
TYMED_ISTREAM
;
stgmed
->
u
.
pstm
=
&
stream
->
IStream_iface
;
stgmed
->
pstm
=
&
stream
->
IStream_iface
;
stgmed
->
pUnkForRelease
=
&
stream
->
buf
->
IUnknown_iface
;
return
S_OK
;
...
...
@@ -735,7 +733,7 @@ static HRESULT stgmed_file_fill_stgmed(stgmed_obj_t *obj, STGMEDIUM *stgmed)
read_protocol_data
(
file_obj
->
buf
);
stgmed
->
tymed
=
TYMED_FILE
;
stgmed
->
u
.
lpszFileName
=
file_obj
->
buf
->
cache_file
;
stgmed
->
lpszFileName
=
file_obj
->
buf
->
cache_file
;
stgmed
->
pUnkForRelease
=
&
file_obj
->
buf
->
IUnknown_iface
;
return
S_OK
;
...
...
dlls/urlmon/http.c
View file @
dd44930b
...
...
@@ -17,8 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#include "urlmon_main.h"
#include "wininet.h"
...
...
@@ -251,7 +249,7 @@ static ULONG send_http_request(HttpProtocol *This)
switch
(
This
->
base
.
bind_info
.
stgmedData
.
tymed
)
{
case
TYMED_HGLOBAL
:
/* Native does not use GlobalLock/GlobalUnlock, so we won't either */
send_buffer
.
lpvBuffer
=
This
->
base
.
bind_info
.
stgmedData
.
u
.
hGlobal
;
send_buffer
.
lpvBuffer
=
This
->
base
.
bind_info
.
stgmedData
.
hGlobal
;
send_buffer
.
dwBufferLength
=
send_buffer
.
dwBufferTotal
=
This
->
base
.
bind_info
.
cbstgmedData
;
break
;
case
TYMED_ISTREAM
:
{
...
...
@@ -259,7 +257,7 @@ static ULONG send_http_request(HttpProtocol *This)
send_buffer
.
dwBufferTotal
=
This
->
base
.
bind_info
.
cbstgmedData
;
if
(
!
This
->
base
.
post_stream
)
{
This
->
base
.
post_stream
=
This
->
base
.
bind_info
.
stgmedData
.
u
.
pstm
;
This
->
base
.
post_stream
=
This
->
base
.
bind_info
.
stgmedData
.
pstm
;
IStream_AddRef
(
This
->
base
.
post_stream
);
}
...
...
@@ -791,7 +789,7 @@ static HRESULT WINAPI HttpProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGE
DWORD
dwOrigin
,
ULARGE_INTEGER
*
plibNewPosition
)
{
HttpProtocol
*
This
=
impl_from_IInternetProtocolEx
(
iface
);
FIXME
(
"(%p)->(%ld %ld %p)
\n
"
,
This
,
dlibMove
.
u
.
LowPart
,
dwOrigin
,
plibNewPosition
);
FIXME
(
"(%p)->(%ld %ld %p)
\n
"
,
This
,
dlibMove
.
LowPart
,
dwOrigin
,
plibNewPosition
);
return
E_NOTIMPL
;
}
...
...
dlls/urlmon/urlmon_main.c
View file @
dd44930b
...
...
@@ -20,8 +20,6 @@
#include <stdarg.h>
#define NONAMELESSUNION
#include "urlmon_main.h"
#include "winreg.h"
...
...
@@ -598,32 +596,32 @@ HRESULT WINAPI CopyStgMedium(const STGMEDIUM *src, STGMEDIUM *dst)
case
TYMED_NULL
:
break
;
case
TYMED_FILE
:
if
(
src
->
u
.
lpszFileName
&&
!
src
->
pUnkForRelease
)
{
DWORD
size
=
(
lstrlenW
(
src
->
u
.
lpszFileName
)
+
1
)
*
sizeof
(
WCHAR
);
dst
->
u
.
lpszFileName
=
CoTaskMemAlloc
(
size
);
if
(
!
dst
->
u
.
lpszFileName
)
if
(
src
->
lpszFileName
&&
!
src
->
pUnkForRelease
)
{
DWORD
size
=
(
lstrlenW
(
src
->
lpszFileName
)
+
1
)
*
sizeof
(
WCHAR
);
dst
->
lpszFileName
=
CoTaskMemAlloc
(
size
);
if
(
!
dst
->
lpszFileName
)
return
E_OUTOFMEMORY
;
memcpy
(
dst
->
u
.
lpszFileName
,
src
->
u
.
lpszFileName
,
size
);
memcpy
(
dst
->
lpszFileName
,
src
->
lpszFileName
,
size
);
}
break
;
case
TYMED_ISTREAM
:
if
(
dst
->
u
.
pstm
)
IStream_AddRef
(
dst
->
u
.
pstm
);
if
(
dst
->
pstm
)
IStream_AddRef
(
dst
->
pstm
);
break
;
case
TYMED_ISTORAGE
:
if
(
dst
->
u
.
pstg
)
IStorage_AddRef
(
dst
->
u
.
pstg
);
if
(
dst
->
pstg
)
IStorage_AddRef
(
dst
->
pstg
);
break
;
case
TYMED_HGLOBAL
:
if
(
dst
->
u
.
hGlobal
)
{
SIZE_T
size
=
GlobalSize
(
src
->
u
.
hGlobal
);
if
(
dst
->
hGlobal
)
{
SIZE_T
size
=
GlobalSize
(
src
->
hGlobal
);
char
*
src_ptr
,
*
dst_ptr
;
dst
->
u
.
hGlobal
=
GlobalAlloc
(
GMEM_FIXED
,
size
);
if
(
!
dst
->
u
.
hGlobal
)
dst
->
hGlobal
=
GlobalAlloc
(
GMEM_FIXED
,
size
);
if
(
!
dst
->
hGlobal
)
return
E_OUTOFMEMORY
;
dst_ptr
=
GlobalLock
(
dst
->
u
.
hGlobal
);
src_ptr
=
GlobalLock
(
src
->
u
.
hGlobal
);
dst_ptr
=
GlobalLock
(
dst
->
hGlobal
);
src_ptr
=
GlobalLock
(
src
->
hGlobal
);
memcpy
(
dst_ptr
,
src_ptr
,
size
);
GlobalUnlock
(
src_ptr
);
GlobalUnlock
(
dst_ptr
);
...
...
dlls/urlmon/usrmarshal.c
View file @
dd44930b
...
...
@@ -16,8 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#include "urlmon_main.h"
#include "wine/debug.h"
...
...
@@ -93,7 +91,7 @@ static HRESULT marshal_stgmed(STGMEDIUM *stgmed, RemSTGMEDIUM **ret)
ULONG
size
=
0
;
HRESULT
hres
=
S_OK
;
if
((
stgmed
->
tymed
==
TYMED_ISTREAM
&&
stgmed
->
u
.
pstm
)
||
stgmed
->
pUnkForRelease
)
{
if
((
stgmed
->
tymed
==
TYMED_ISTREAM
&&
stgmed
->
pstm
)
||
stgmed
->
pUnkForRelease
)
{
hres
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -103,8 +101,8 @@ static HRESULT marshal_stgmed(STGMEDIUM *stgmed, RemSTGMEDIUM **ret)
case
TYMED_NULL
:
break
;
case
TYMED_ISTREAM
:
if
(
stgmed
->
u
.
pstm
)
hres
=
CoMarshalInterface
(
stream
,
&
IID_IStream
,
(
IUnknown
*
)
stgmed
->
u
.
pstm
,
if
(
stgmed
->
pstm
)
hres
=
CoMarshalInterface
(
stream
,
&
IID_IStream
,
(
IUnknown
*
)
stgmed
->
pstm
,
MSHCTX_LOCAL
,
NULL
,
MSHLFLAGS_NORMAL
);
break
;
default:
...
...
@@ -140,7 +138,7 @@ static HRESULT marshal_stgmed(STGMEDIUM *stgmed, RemSTGMEDIUM **ret)
rem_stgmed
->
tymed
=
stgmed
->
tymed
;
rem_stgmed
->
dwHandleType
=
0
;
rem_stgmed
->
pData
=
stgmed
->
u
.
pstm
!=
NULL
;
rem_stgmed
->
pData
=
stgmed
->
pstm
!=
NULL
;
rem_stgmed
->
pUnkForRelease
=
stgmed
->
pUnkForRelease
!=
NULL
;
rem_stgmed
->
cbData
=
size
;
if
(
stream
)
{
...
...
@@ -181,7 +179,7 @@ static HRESULT unmarshal_stgmed(RemSTGMEDIUM *rem_stgmed, STGMEDIUM *stgmed)
break
;
case
TYMED_ISTREAM
:
if
(
rem_stgmed
->
pData
)
hres
=
CoUnmarshalInterface
(
stream
,
&
IID_IStream
,
(
void
**
)
&
stgmed
->
u
.
pstm
);
hres
=
CoUnmarshalInterface
(
stream
,
&
IID_IStream
,
(
void
**
)
&
stgmed
->
pstm
);
break
;
default:
FIXME
(
"unsupported tymed %lu
\n
"
,
stgmed
->
tymed
);
...
...
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