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
32288763
Commit
32288763
authored
Dec 29, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wshom.ocx: Added IDispatch support for IWshShell3.
parent
59619073
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
8 deletions
+115
-8
Makefile.in
dlls/wshom.ocx/Makefile.in
+1
-0
shell.c
dlls/wshom.ocx/shell.c
+31
-6
wshom.c
dlls/wshom.ocx/tests/wshom.c
+5
-1
wshom_main.c
dlls/wshom.ocx/wshom_main.c
+69
-1
wshom_private.h
dlls/wshom.ocx/wshom_private.h
+9
-0
No files found.
dlls/wshom.ocx/Makefile.in
View file @
32288763
MODULE
=
wshom.ocx
IMPORTS
=
uuid oleaut32
C_SRCS
=
\
shell.c
\
...
...
dlls/wshom.ocx/shell.c
View file @
32288763
...
...
@@ -23,6 +23,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wshom
);
static
IWshShell3
WshShell3
;
static
HRESULT
WINAPI
WshShell3_QueryInterface
(
IWshShell3
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
...
...
@@ -66,23 +68,46 @@ static HRESULT WINAPI WshShell3_GetTypeInfoCount(IWshShell3 *iface, UINT *pctinf
static
HRESULT
WINAPI
WshShell3_GetTypeInfo
(
IWshShell3
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
FIXM
E
(
"(%u %u %p)
\n
"
,
iTInfo
,
lcid
,
ppTInfo
);
return
E_NOTIMPL
;
TRAC
E
(
"(%u %u %p)
\n
"
,
iTInfo
,
lcid
,
ppTInfo
);
return
get_typeinfo
(
IWshShell3_tid
,
ppTInfo
)
;
}
static
HRESULT
WINAPI
WshShell3_GetIDsOfNames
(
IWshShell3
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
FIXME
(
"(%s %p %u %u %p)
\n
"
,
debugstr_guid
(
riid
),
rgszNames
,
cNames
,
lcid
,
rgDispId
);
return
E_NOTIMPL
;
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
TRACE
(
"(%s %p %u %u %p)
\n
"
,
debugstr_guid
(
riid
),
rgszNames
,
cNames
,
lcid
,
rgDispId
);
hr
=
get_typeinfo
(
IWshShell3_tid
,
&
typeinfo
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ITypeInfo_GetIDsOfNames
(
typeinfo
,
rgszNames
,
cNames
,
rgDispId
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
static
HRESULT
WINAPI
WshShell3_Invoke
(
IWshShell3
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
FIXME
(
"(%d %s %d %d %p %p %p %p)
\n
"
,
dispIdMember
,
debugstr_guid
(
riid
),
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
TRACE
(
"(%d %s %d %d %p %p %p %p)
\n
"
,
dispIdMember
,
debugstr_guid
(
riid
),
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
return
E_NOTIMPL
;
hr
=
get_typeinfo
(
IWshShell3_tid
,
&
typeinfo
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ITypeInfo_Invoke
(
typeinfo
,
&
WshShell3
,
dispIdMember
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
static
HRESULT
WINAPI
WshShell3_get_SpecialFolders
(
IWshShell3
*
iface
,
IWshCollection
**
out_Folders
)
...
...
dlls/wshom.ocx/tests/wshom.c
View file @
32288763
...
...
@@ -31,6 +31,7 @@ DEFINE_GUID(IID_IWshShell3, 0x41904400, 0xbe18, 0x11d3, 0xa2,0x8b, 0x00,0x10,0x4
static
void
test_wshshell
(
void
)
{
IDispatchEx
*
dispex
;
IDispatch
*
disp
;
IUnknown
*
shell
;
HRESULT
hres
;
...
...
@@ -43,9 +44,12 @@ static void test_wshshell(void)
}
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IWshShell3
,
(
void
**
)
&
shell
);
IDispatch_Release
(
disp
);
ok
(
hres
==
S_OK
,
"Could not get IWshShell3 iface: %08x
\n
"
,
hres
);
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
ok
(
hres
==
E_NOINTERFACE
,
"got %08x
\n
"
,
hres
);
IDispatch_Release
(
disp
);
IUnknown_Release
(
shell
);
}
...
...
dlls/wshom.ocx/wshom_main.c
View file @
32288763
...
...
@@ -16,8 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "initguid.h"
#include "wshom_private.h"
#include "initguid.h"
#include "wshom.h"
#include "rpcproxy.h"
...
...
@@ -27,6 +28,70 @@ WINE_DEFAULT_DEBUG_CHANNEL(wshom);
static
HINSTANCE
wshom_instance
;
static
ITypeLib
*
typelib
;
static
ITypeInfo
*
typeinfos
[
LAST_tid
];
static
REFIID
tid_ids
[]
=
{
&
IID_NULL
,
&
IID_IWshShell3
};
static
HRESULT
load_typelib
(
void
)
{
HRESULT
hres
;
ITypeLib
*
tl
;
hres
=
LoadRegTypeLib
(
&
LIBID_IWshRuntimeLibrary
,
1
,
0
,
LOCALE_SYSTEM_DEFAULT
,
&
tl
);
if
(
FAILED
(
hres
))
{
ERR
(
"LoadRegTypeLib failed: %08x
\n
"
,
hres
);
return
hres
;
}
if
(
InterlockedCompareExchangePointer
((
void
**
)
&
typelib
,
tl
,
NULL
))
ITypeLib_Release
(
tl
);
return
hres
;
}
HRESULT
get_typeinfo
(
tid_t
tid
,
ITypeInfo
**
typeinfo
)
{
HRESULT
hres
;
if
(
!
typelib
)
hres
=
load_typelib
();
if
(
!
typelib
)
return
hres
;
if
(
!
typeinfos
[
tid
])
{
ITypeInfo
*
ti
;
hres
=
ITypeLib_GetTypeInfoOfGuid
(
typelib
,
tid_ids
[
tid
],
&
ti
);
if
(
FAILED
(
hres
))
{
ERR
(
"GetTypeInfoOfGuid(%s) failed: %08x
\n
"
,
debugstr_guid
(
tid_ids
[
tid
]),
hres
);
return
hres
;
}
if
(
InterlockedCompareExchangePointer
((
void
**
)(
typeinfos
+
tid
),
ti
,
NULL
))
ITypeInfo_Release
(
ti
);
}
*
typeinfo
=
typeinfos
[
tid
];
return
S_OK
;
}
void
release_typelib
(
void
)
{
unsigned
i
;
if
(
!
typelib
)
return
;
for
(
i
=
0
;
i
<
sizeof
(
typeinfos
)
/
sizeof
(
*
typeinfos
);
i
++
)
if
(
typeinfos
[
i
])
ITypeInfo_Release
(
typeinfos
[
i
]);
ITypeLib_Release
(
typelib
);
}
static
HRESULT
WINAPI
ClassFactory_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
*
ppv
=
NULL
;
...
...
@@ -91,6 +156,9 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
wshom_instance
=
hInstDLL
;
DisableThreadLibraryCalls
(
wshom_instance
);
break
;
case
DLL_PROCESS_DETACH
:
release_typelib
();
break
;
}
return
TRUE
;
...
...
dlls/wshom.ocx/wshom_private.h
View file @
32288763
...
...
@@ -24,4 +24,13 @@
#include "winbase.h"
#include "ole2.h"
/* typelibs */
typedef
enum
tid_t
{
NULL_tid
,
IWshShell3_tid
,
LAST_tid
}
tid_t
;
HRESULT
get_typeinfo
(
tid_t
tid
,
ITypeInfo
**
typeinfo
);
HRESULT
WINAPI
WshShellFactory_CreateInstance
(
IClassFactory
*
,
IUnknown
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
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