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
6c5588f9
Commit
6c5588f9
authored
Jun 15, 2012
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Jul 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Add typelib support.
parent
45f240c0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
127 additions
and
12 deletions
+127
-12
Makefile.in
dlls/scrrun/Makefile.in
+1
-1
filesystem.c
dlls/scrrun/filesystem.c
+28
-9
scrrun.c
dlls/scrrun/scrrun.c
+66
-2
scrrun_private.h
dlls/scrrun/scrrun_private.h
+32
-0
No files found.
dlls/scrrun/Makefile.in
View file @
6c5588f9
MODULE
=
scrrun.dll
IMPORTS
=
uuid
IMPORTS
=
uuid
oleaut32
C_SRCS
=
\
filesystem.c
\
...
...
dlls/scrrun/filesystem.c
View file @
6c5588f9
...
...
@@ -26,6 +26,7 @@
#include "ole2.h"
#include "dispex.h"
#include "scrrun.h"
#include "scrrun_private.h"
#include "wine/debug.h"
...
...
@@ -90,19 +91,26 @@ static HRESULT WINAPI filesys_GetTypeInfoCount(IFileSystem3 *iface, UINT *pctinf
static
HRESULT
WINAPI
filesys_GetTypeInfo
(
IFileSystem3
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
FIXME
(
"(%p)->(%u %u %p)
\n
"
,
iface
,
iTInfo
,
lcid
,
ppTInfo
);
return
E_NOTIMPL
;
}
TRACE
(
"(%p)->(%u %u %p)
\n
"
,
iface
,
iTInfo
,
lcid
,
ppTInfo
);
return
get_typeinfo
(
IFileSystem3_tid
,
ppTInfo
);}
static
HRESULT
WINAPI
filesys_GetIDsOfNames
(
IFileSystem3
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
FIXME
(
"(%p)->(%s %p %u %u %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
rgszNames
,
cNames
,
lcid
,
rgDispId
)
;
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%s %p %u %u %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
rgszNames
,
cNames
,
lcid
,
rgDispId
);
hr
=
get_typeinfo
(
IFileSystem3_tid
,
&
typeinfo
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ITypeInfo_GetIDsOfNames
(
typeinfo
,
rgszNames
,
cNames
,
rgDispId
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
static
HRESULT
WINAPI
filesys_Invoke
(
IFileSystem3
*
iface
,
DISPID
dispIdMember
,
...
...
@@ -110,10 +118,21 @@ static HRESULT WINAPI filesys_Invoke(IFileSystem3 *iface, DISPID dispIdMember,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
FIXME
(
"(%p)->(%d %s %d %d %p %p %p %p)
\n
"
,
iface
,
dispIdMember
,
debugstr_guid
(
riid
),
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
TRACE
(
"(%p)->(%d %s %d %d %p %p %p %p)
\n
"
,
iface
,
dispIdMember
,
debugstr_guid
(
riid
),
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
return
E_NOTIMPL
;
hr
=
get_typeinfo
(
IFileSystem3_tid
,
&
typeinfo
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ITypeInfo_Invoke
(
typeinfo
,
&
iface
,
dispIdMember
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
static
HRESULT
WINAPI
filesys_get_Drives
(
IFileSystem3
*
iface
,
IDriveCollection
**
ppdrives
)
...
...
dlls/scrrun/scrrun.c
View file @
6c5588f9
...
...
@@ -27,6 +27,7 @@
#include <initguid.h>
#include "scrrun.h"
#include "scrrun_private.h"
#include "wine/debug.h"
...
...
@@ -36,8 +37,6 @@ static HINSTANCE scrrun_instance;
typedef
HRESULT
(
*
fnCreateInstance
)(
LPVOID
*
ppObj
);
extern
HRESULT
WINAPI
FileSystem_CreateInstance
(
IClassFactory
*
,
IUnknown
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
static
HRESULT
WINAPI
scrruncf_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
LPVOID
*
ppv
)
{
*
ppv
=
NULL
;
...
...
@@ -88,6 +87,70 @@ static const struct IClassFactoryVtbl scrruncf_vtbl =
static
IClassFactory
FileSystemFactory
=
{
&
scrruncf_vtbl
};
static
ITypeLib
*
typelib
;
static
ITypeInfo
*
typeinfos
[
LAST_tid
];
static
REFIID
tid_ids
[]
=
{
&
IID_NULL
,
&
IID_IFileSystem3
,
};
static
HRESULT
load_typelib
(
void
)
{
HRESULT
hres
;
ITypeLib
*
tl
;
hres
=
LoadRegTypeLib
(
&
LIBID_Scripting
,
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
;
}
static
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
);
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hinst
,
DWORD
reason
,
LPVOID
reserved
)
{
TRACE
(
"%p, %u, %p
\n
"
,
hinst
,
reason
,
reserved
);
...
...
@@ -101,6 +164,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
scrrun_instance
=
hinst
;
break
;
case
DLL_PROCESS_DETACH
:
release_typelib
();
break
;
}
return
TRUE
;
...
...
dlls/scrrun/scrrun_private.h
0 → 100644
View file @
6c5588f9
/*
* Copyright 2012 Alistair Leslie-Hughes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _SCRRUN_PRIVATE_H_
#define _SCRRUN_PRIVATE_H
extern
HRESULT
WINAPI
FileSystem_CreateInstance
(
IClassFactory
*
,
IUnknown
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
typedef
enum
tid_t
{
NULL_tid
,
IFileSystem3_tid
,
LAST_tid
}
tid_t
;
HRESULT
get_typeinfo
(
tid_t
tid
,
ITypeInfo
**
typeinfo
)
DECLSPEC_HIDDEN
;
#endif
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