more stuff for ddraw.dll not tested yet.

svn path=/trunk/; revision=14165
This commit is contained in:
Magnus Olsen 2005-03-17 20:15:44 +00:00
parent eabbaacd53
commit 02755a61f0
3 changed files with 46 additions and 17 deletions

View file

@ -12,7 +12,7 @@ TARGET_CFLAGS = -D__USE_W32API -I$(PATH_TO_TOP)/include/wine
# require os code to explicitly request A/W version of structs/functions
TARGET_CFLAGS += -D_DISABLE_TIDENTS -Wall -Werror
TARGET_SDKLIBS = ntdll.a gdi32.a dxguid.a ole32.a user32.a
TARGET_SDKLIBS = ntdll.a gdi32.a dxguid.a ole32.a user32.a d3d8thk.a
TARGET_OBJECTS = \

View file

@ -10,27 +10,18 @@
*/
#include <windows.h>
//#include <ddraw.h>
#include "ddraw.h"
#include "rosddraw.h"
#define DD_OK 0
HRESULT STDCALL DirectDrawCreate(
GUID FAR* lpGUID,
DWORD FAR* lplpDD,
IUnknown FAR* pUnkOuter
)
{
return DD_OK;
HRESULT WINAPI DirectDrawCreate(LPGUID lpGUID, LPVOID* lplpDD, LPUNKNOWN pUnkOuter)
{
return DDRAW_Create(lpGUID, (LPVOID*) lplpDD, pUnkOuter, &IID_IDirectDraw, FALSE);
}
HRESULT STDCALL DirectDrawCreateEx(
GUID FAR* lpGUID,
DWORD FAR* lplpDD,
DWORD Unknown3,
IUnknown FAR* pUnkOuter
)
HRESULT WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID* lplpDD, REFIID iid, LPUNKNOWN pUnkOuter)
{
return DD_OK;
return DDRAW_Create(lpGUID, lplpDD, pUnkOuter, iid, TRUE);
}
HRESULT WINAPI DirectDrawEnumerateA(
@ -77,6 +68,29 @@ HRESULT WINAPI DirectDrawCreateClipper(
return DD_OK;
}
HRESULT DDRAW_Create(
LPGUID lpGUID, LPVOID *lplpDD, LPUNKNOWN pUnkOuter, REFIID iid, BOOL ex)
{
HDC desktop;
/* BOOL ex == TRUE it is DirectDrawCreateEx call here. */
/* TODO:
check the GUID are right
add scanner that DirectDrawCreate / DirectDrawCreateEx select right driver.
now we will assume it is the current display driver
*/
if (pUnkOuter != NULL) return DDERR_INVALIDPARAMS;
desktop = GetWindowDC(GetDesktopWindow());
lplpDD = OsThunkDdCreateDirectDrawObject(desktop);
if (lplpDD == NULL) return DDERR_NODIRECTDRAWHW;
return DD_OK;
}
BOOL WINAPI DllMain(HINSTANCE hInstance,DWORD fwdReason, LPVOID lpvReserved)
{
switch(fwdReason)

View file

@ -0,0 +1,15 @@
/*
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: lib/ddraw/ddraw.c
* PURPOSE: ddraw lib
* PROGRAMMER: Magnus Olsen
* UPDATE HISTORY:
*/
HANDLE STDCALL OsThunkDdCreateDirectDrawObject(HDC hdc);
HRESULT DDRAW_Create(LPGUID lpGUID, LPVOID *lplpDD, LPUNKNOWN pUnkOuter, REFIID iid, BOOL ex);