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
55c717e8
Commit
55c717e8
authored
Mar 24, 2011
by
David Hedberg
Committed by
Alexandre Julliard
Mar 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Add DllGetClassObject and a default class factory.
parent
ddada675
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
0 deletions
+98
-0
cdlg32.c
dlls/comdlg32/cdlg32.c
+97
-0
comdlg32.spec
dlls/comdlg32/comdlg32.spec
+1
-0
No files found.
dlls/comdlg32/cdlg32.c
View file @
55c717e8
...
...
@@ -21,6 +21,8 @@
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
...
...
@@ -167,3 +169,98 @@ DWORD WINAPI CommDlgExtendedError(void)
else
return
0
;
/* we never set an error, so there isn't one */
}
/*************************************************************************
* Implement the CommDlg32 class factory
*
* (Taken from shdocvw/factory.c; based on implementation in
* ddraw/main.c)
*/
typedef
struct
{
IClassFactory
IClassFactory_iface
;
HRESULT
(
*
cf
)(
IUnknown
*
,
REFIID
,
void
**
);
}
IClassFactoryImpl
;
static
inline
IClassFactoryImpl
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IClassFactoryImpl
,
IClassFactory_iface
);
}
/*************************************************************************
* CDLGCF_QueryInterface (IUnknown)
*/
static
HRESULT
WINAPI
CDLGCF_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
ppobj
)
{
TRACE
(
"%p (%s %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppobj
);
if
(
!
ppobj
)
return
E_POINTER
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IClassFactory
,
riid
))
{
*
ppobj
=
iface
;
IClassFactory_AddRef
(
iface
);
return
S_OK
;
}
WARN
(
"Interface not supported.
\n
"
);
*
ppobj
=
NULL
;
return
E_NOINTERFACE
;
}
/*************************************************************************
* CDLGCF_AddRef (IUnknown)
*/
static
ULONG
WINAPI
CDLGCF_AddRef
(
IClassFactory
*
iface
)
{
return
2
;
/* non-heap based object */
}
/*************************************************************************
* CDLGCF_Release (IUnknown)
*/
static
ULONG
WINAPI
CDLGCF_Release
(
IClassFactory
*
iface
)
{
return
1
;
/* non-heap based object */
}
/*************************************************************************
* CDLGCF_CreateInstance (IClassFactory)
*/
static
HRESULT
WINAPI
CDLGCF_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
pOuter
,
REFIID
riid
,
void
**
ppobj
)
{
IClassFactoryImpl
*
This
=
impl_from_IClassFactory
(
iface
);
return
This
->
cf
(
pOuter
,
riid
,
ppobj
);
}
/*************************************************************************
* CDLGCF_LockServer (IClassFactory)
*/
static
HRESULT
WINAPI
CDLGCF_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
{
TRACE
(
"%p (%d)
\n
"
,
iface
,
dolock
);
return
S_OK
;
}
static
const
IClassFactoryVtbl
CDLGCF_Vtbl
=
{
CDLGCF_QueryInterface
,
CDLGCF_AddRef
,
CDLGCF_Release
,
CDLGCF_CreateInstance
,
CDLGCF_LockServer
};
/*************************************************************************
* DllGetClassObject (COMMDLG32.@)
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
void
**
ppv
)
{
TRACE
(
"%s, %s, %p
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
return
CLASS_E_CLASSNOTAVAILABLE
;
}
dlls/comdlg32/comdlg32.spec
View file @
55c717e8
...
...
@@ -3,6 +3,7 @@
@ stdcall ChooseFontA(ptr)
@ stdcall ChooseFontW(ptr)
@ stdcall CommDlgExtendedError()
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall FindTextA(ptr)
@ stdcall FindTextW(ptr)
@ stdcall GetFileTitleA(str ptr long)
...
...
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