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
969ae13e
Commit
969ae13e
authored
May 06, 2006
by
Roderick Colenbrander
Committed by
Alexandre Julliard
May 08, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput8: DllGetClassObject support.
parent
af462957
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
11 deletions
+87
-11
Makefile.in
dlls/dinput8/Makefile.in
+1
-1
dinput8_main.c
dlls/dinput8/dinput8_main.c
+86
-10
No files found.
dlls/dinput8/Makefile.in
View file @
969ae13e
...
...
@@ -5,7 +5,7 @@ VPATH = @srcdir@
MODULE
=
dinput8.dll
IMPORTLIB
=
libdinput8.
$(IMPLIBEXT)
IMPORTS
=
dinput kernel32
EXTRALIBS
=
-luuid
EXTRALIBS
=
-luuid
-ldxguid
C_SRCS
=
\
dinput8_main.c
...
...
dlls/dinput8/dinput8_main.c
View file @
969ae13e
/* DirectInput 8
*
* Copyright 2002 TransGaming Technologies Inc.
* Copyright 2006 Roderick Colenbrander
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -22,6 +23,8 @@
#include <stdarg.h>
#include <string.h>
#define COBJMACROS
#include "wine/debug.h"
#include "windef.h"
#include "winbase.h"
...
...
@@ -29,25 +32,93 @@
#include "dinput.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dinput
);
static
LONG
dll_count
;
/*
* Dll lifetime tracking declaration
*/
static
void
LockModule
(
void
)
{
InterlockedIncrement
(
&
dll_count
);
}
static
void
UnlockModule
(
void
)
{
InterlockedDecrement
(
&
dll_count
);
}
/******************************************************************************
* DirectInput8Create (DINPUT8.@)
*/
HRESULT
WINAPI
DirectInput8Create
(
HINSTANCE
hinst
,
DWORD
dwVersion
,
REFIID
riid
,
LPVOID
*
ppDI
,
LPUNKNOWN
punkOuter
)
{
return
DirectInputCreateEx
(
hinst
,
dwVersion
,
riid
,
ppDI
,
punkOuter
);
HRESULT
WINAPI
DirectInput8Create
(
HINSTANCE
hinst
,
DWORD
dwVersion
,
REFIID
riid
,
LPVOID
*
ppDI
,
LPUNKNOWN
punkOuter
)
{
/* TODO: Create the interface using CoCreateInstance as that's what windows does too and check if the version number >= 0x800 */
return
DirectInputCreateEx
(
hinst
,
dwVersion
,
riid
,
ppDI
,
punkOuter
);
}
/*******************************************************************************
* DirectInput8 ClassFactory
*/
typedef
struct
{
/* IUnknown fields */
const
IClassFactoryVtbl
*
lpVtbl
;
}
IClassFactoryImpl
;
static
HRESULT
WINAPI
DI8CF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"%p %s %p
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
DI8CF_AddRef
(
LPCLASSFACTORY
iface
)
{
LockModule
();
return
2
;
}
static
ULONG
WINAPI
DI8CF_Release
(
LPCLASSFACTORY
iface
)
{
UnlockModule
();
return
1
;
}
static
HRESULT
WINAPI
DI8CF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
if
(
IsEqualGUID
(
&
IID_IDirectInput8A
,
riid
)
||
IsEqualGUID
(
&
IID_IDirectInput8W
,
riid
)
)
{
return
DirectInput8Create
(
0
,
DIRECTINPUT_VERSION
,
riid
,
ppobj
,
pOuter
);
}
ERR
(
"(%p,%p,%s,%p) Interface not found!
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
return
E_NOINTERFACE
;
}
static
HRESULT
WINAPI
DI8CF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
TRACE
(
"(%p)->(%d)
\n
"
,
iface
,
dolock
);
if
(
dolock
)
LockModule
();
else
UnlockModule
();
return
S_OK
;
}
static
const
IClassFactoryVtbl
DI8CF_Vtbl
=
{
DI8CF_QueryInterface
,
DI8CF_AddRef
,
DI8CF_Release
,
DI8CF_CreateInstance
,
DI8CF_LockServer
};
static
IClassFactoryImpl
DINPUT8_CF
=
{
&
DI8CF_Vtbl
};
/***********************************************************************
* DllCanUnloadNow (DINPUT8.@)
*/
HRESULT
WINAPI
DllCanUnloadNow
(
void
)
{
FIXME
(
"(void): stub
\n
"
);
return
S_FALSE
;
return
dll_count
==
0
?
S_OK
:
S_FALSE
;
}
/***********************************************************************
...
...
@@ -55,9 +126,14 @@ HRESULT WINAPI DllCanUnloadNow(void)
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
)
{
FIXME
(
"(%p, %p, %p): stub
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
TRACE
(
"(%s,%s,%p)
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
if
(
IsEqualCLSID
(
&
IID_IClassFactory
,
riid
)
)
{
*
ppv
=
(
LPVOID
)
&
DINPUT8_CF
;
IClassFactory_AddRef
((
IClassFactory
*
)
*
ppv
);
return
S_OK
;
}
FIXME
(
"(%s,%s,%p): no interface found.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
return
CLASS_E_CLASSNOTAVAILABLE
;
}
...
...
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