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
d1443c3a
Commit
d1443c3a
authored
Nov 22, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shcore: Implement method wrapper functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
539f2f15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
169 additions
and
9 deletions
+169
-9
main.c
dlls/shcore/main.c
+160
-0
shcore.spec
dlls/shcore/shcore.spec
+9
-9
No files found.
dlls/shcore/main.c
View file @
d1443c3a
...
...
@@ -19,10 +19,14 @@
#include "config.h"
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "initguid.h"
#include "ocidl.h"
#include "shellscalingapi.h"
#include "wine/debug.h"
...
...
@@ -61,3 +65,159 @@ HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x
if
(
GetDpiForMonitorInternal
(
monitor
,
type
,
x
,
y
))
return
S_OK
;
return
HRESULT_FROM_WIN32
(
GetLastError
()
);
}
HRESULT
WINAPI
_IStream_Read
(
IStream
*
stream
,
void
*
dest
,
ULONG
size
)
{
ULONG
read
;
HRESULT
hr
;
TRACE
(
"(%p, %p, %u)
\n
"
,
stream
,
dest
,
size
);
hr
=
IStream_Read
(
stream
,
dest
,
size
,
&
read
);
if
(
SUCCEEDED
(
hr
)
&&
read
!=
size
)
hr
=
E_FAIL
;
return
hr
;
}
HRESULT
WINAPI
IStream_Reset
(
IStream
*
stream
)
{
static
const
LARGE_INTEGER
zero
;
TRACE
(
"(%p)
\n
"
,
stream
);
return
IStream_Seek
(
stream
,
zero
,
0
,
NULL
);
}
HRESULT
WINAPI
IStream_Size
(
IStream
*
stream
,
ULARGE_INTEGER
*
size
)
{
STATSTG
statstg
;
HRESULT
hr
;
TRACE
(
"(%p, %p)
\n
"
,
stream
,
size
);
memset
(
&
statstg
,
0
,
sizeof
(
statstg
));
hr
=
IStream_Stat
(
stream
,
&
statstg
,
STATFLAG_NONAME
);
if
(
SUCCEEDED
(
hr
)
&&
size
)
*
size
=
statstg
.
cbSize
;
return
hr
;
}
HRESULT
WINAPI
_IStream_Write
(
IStream
*
stream
,
const
void
*
src
,
ULONG
size
)
{
ULONG
written
;
HRESULT
hr
;
TRACE
(
"(%p, %p, %u)
\n
"
,
stream
,
src
,
size
);
hr
=
IStream_Write
(
stream
,
src
,
size
,
&
written
);
if
(
SUCCEEDED
(
hr
)
&&
written
!=
size
)
hr
=
E_FAIL
;
return
hr
;
}
void
WINAPI
IUnknown_AtomicRelease
(
IUnknown
**
obj
)
{
TRACE
(
"(%p)
\n
"
,
obj
);
if
(
!
obj
||
!*
obj
)
return
;
IUnknown_Release
(
*
obj
);
*
obj
=
NULL
;
}
HRESULT
WINAPI
IUnknown_GetSite
(
IUnknown
*
unk
,
REFIID
iid
,
void
**
site
)
{
IObjectWithSite
*
obj
=
NULL
;
HRESULT
hr
=
E_INVALIDARG
;
TRACE
(
"(%p, %s, %p)
\n
"
,
unk
,
debugstr_guid
(
iid
),
site
);
if
(
unk
&&
iid
&&
site
)
{
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IObjectWithSite
,
(
void
**
)
&
obj
);
if
(
SUCCEEDED
(
hr
)
&&
obj
)
{
hr
=
IObjectWithSite_GetSite
(
obj
,
iid
,
site
);
IObjectWithSite_Release
(
obj
);
}
}
return
hr
;
}
HRESULT
WINAPI
IUnknown_QueryService
(
IUnknown
*
obj
,
REFGUID
sid
,
REFIID
iid
,
void
**
out
)
{
IServiceProvider
*
provider
=
NULL
;
HRESULT
hr
;
if
(
!
out
)
return
E_FAIL
;
*
out
=
NULL
;
if
(
!
obj
)
return
E_FAIL
;
hr
=
IUnknown_QueryInterface
(
obj
,
&
IID_IServiceProvider
,
(
void
**
)
&
provider
);
if
(
hr
==
S_OK
&&
provider
)
{
TRACE
(
"Using provider %p.
\n
"
,
provider
);
hr
=
IServiceProvider_QueryService
(
provider
,
sid
,
iid
,
out
);
TRACE
(
"Provider %p returned %p.
\n
"
,
provider
,
*
out
);
IServiceProvider_Release
(
provider
);
}
return
hr
;
}
void
WINAPI
IUnknown_Set
(
IUnknown
**
dest
,
IUnknown
*
src
)
{
TRACE
(
"(%p, %p)
\n
"
,
dest
,
src
);
IUnknown_AtomicRelease
(
dest
);
if
(
src
)
{
IUnknown_AddRef
(
src
);
*
dest
=
src
;
}
}
HRESULT
WINAPI
IUnknown_SetSite
(
IUnknown
*
obj
,
IUnknown
*
site
)
{
IInternetSecurityManager
*
sec_manager
;
IObjectWithSite
*
objwithsite
;
HRESULT
hr
;
if
(
!
obj
)
return
E_FAIL
;
hr
=
IUnknown_QueryInterface
(
obj
,
&
IID_IObjectWithSite
,
(
void
**
)
&
objwithsite
);
TRACE
(
"ObjectWithSite %p, hr %#x.
\n
"
,
objwithsite
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IObjectWithSite_SetSite
(
objwithsite
,
site
);
TRACE
(
"SetSite() hr %#x.
\n
"
,
hr
);
IObjectWithSite_Release
(
objwithsite
);
}
else
{
hr
=
IUnknown_QueryInterface
(
obj
,
&
IID_IInternetSecurityManager
,
(
void
**
)
&
sec_manager
);
TRACE
(
"InternetSecurityManager %p, hr %#x.
\n
"
,
sec_manager
,
hr
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IInternetSecurityManager_SetSecuritySite
(
sec_manager
,
(
IInternetSecurityMgrSite
*
)
site
);
TRACE
(
"SetSecuritySite() hr %#x.
\n
"
,
hr
);
IInternetSecurityManager_Release
(
sec_manager
);
}
return
hr
;
}
dlls/shcore/shcore.spec
View file @
d1443c3a
...
...
@@ -14,17 +14,17 @@
@ stub GetScaleFactorForDevice
@ stub GetScaleFactorForMonitor
@ stub IStream_Copy
@ stdcall IStream_Read(ptr ptr long)
shlwapi.
IStream_Read
@ stdcall IStream_Read(ptr ptr long)
_
IStream_Read
@ stub IStream_ReadStr
@ stdcall IStream_Reset(ptr)
shlwapi.IStream_Reset
@ stdcall IStream_Size(ptr ptr)
shlwapi.IStream_Size
@ stdcall IStream_Write(ptr ptr long)
shlwapi.
IStream_Write
@ stdcall IStream_Reset(ptr)
@ stdcall IStream_Size(ptr ptr)
@ stdcall IStream_Write(ptr ptr long)
_
IStream_Write
@ stub IStream_WriteStr
@ stdcall IUnknown_AtomicRelease(long)
shlwapi.IUnknown_AtomicRelease
@ stdcall IUnknown_GetSite(ptr ptr ptr)
shlwapi.IUnknown_GetSite
@ stdcall IUnknown_QueryService(ptr ptr ptr ptr)
shlwapi.IUnknown_QueryService
@ stdcall IUnknown_Set(ptr ptr)
shlwapi.IUnknown_Set
@ stdcall IUnknown_SetSite(ptr ptr)
shlwapi.IUnknown_SetSite
@ stdcall IUnknown_AtomicRelease(long)
@ stdcall IUnknown_GetSite(ptr ptr ptr)
@ stdcall IUnknown_QueryService(ptr ptr ptr ptr)
@ stdcall IUnknown_Set(ptr ptr)
@ stdcall IUnknown_SetSite(ptr ptr)
@ stdcall IsOS(long) shlwapi.IsOS
@ stub RegisterScaleChangeEvent
@ stub RegisterScaleChangeNotifications
...
...
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