Author: greatlrd
Date: Sun Nov 4 17:57:57 2007
New Revision: 30117
URL:
http://svn.reactos.org/svn/reactos?rev=30117&view=rev
Log:
Add dxapi.sys, most api are stub.
Implemnt GsDriverEntry, DxApiGetVersion, DxApi.
All DxApi that are callbacks are stub.
Added:
branches/reactx/reactos/drivers/directx/dxapi/dxapi.def (with props)
branches/reactx/reactos/drivers/directx/dxapi/dxapi.rbuild (with props)
branches/reactx/reactos/drivers/directx/dxapi/dxapi.rc (with props)
branches/reactx/reactos/drivers/directx/dxapi/dxapi_driver.h (with props)
branches/reactx/reactos/drivers/directx/dxapi/main.c (with props)
Modified:
branches/reactx/reactos/drivers/directx/directory.rbuild
branches/reactx/reactos/drivers/directx/dxgthk/main.c
Modified: branches/reactx/reactos/drivers/directx/directory.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/directory.rbuild (original)
+++ branches/reactx/reactos/drivers/directx/directory.rbuild Sun Nov 4 17:57:57 2007
@@ -1,6 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE group SYSTEM "../tools/rbuild/project.dtd">
<group
xmlns:xi="http://www.w3.org/2001/XInclude">
+<directory name="dxapi">
+ <xi:include href="dxapi/dxapi.rbuild" />
+</directory>
<directory name="dxg">
<xi:include href="dxg/dxg.rbuild" />
</directory>
Added: branches/reactx/reactos/drivers/directx/dxapi/dxapi.def
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxapi/dxapi.def (added)
+++ branches/reactx/reactos/drivers/directx/dxapi/dxapi.def Sun Nov 4 17:57:57 2007
@@ -1,0 +1,15 @@
+; $Id: videoprt.def 27062 2007-06-07 21:13:06Z greatlrd $
+;
+; dxapi.def - export definition file for ReactOS
+;
+EXPORTS
+DxApi@20
+DxApiGetVersion@0
+;DxApiInitialize@32
+;DxAutoflipUpdate@20
+;DxEnableIRQ@8
+;DxLoseObject@8
+;DxUpdateCapture@12
+GsDriverEntry@8
+
+
Propchange: branches/reactx/reactos/drivers/directx/dxapi/dxapi.def
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/reactx/reactos/drivers/directx/dxapi/dxapi.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxapi/dxapi.rbuild (added)
+++ branches/reactx/reactos/drivers/directx/dxapi/dxapi.rbuild Sun Nov 4 17:57:57 2007
@@ -1,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
+<module name="dxapi" type="kernelmodedriver"
+installbase="system32/drivers" installname="dxapi.sys">
+ <importlibrary definition="dxapi.def" />
+ <include base="dxapi">.</include>
+ <define name="__USE_W32API" />
+ <define name="_DXAPI_" />
+ <library>ntoskrnl</library>
+ <library>hal</library>
+ <library>videoport</library>
+ <file>main.c</file>
+ <file>dxapi.rc</file>
+</module>
Propchange: branches/reactx/reactos/drivers/directx/dxapi/dxapi.rbuild
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/reactx/reactos/drivers/directx/dxapi/dxapi.rc
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxapi/dxapi.rc (added)
+++ branches/reactx/reactos/drivers/directx/dxapi/dxapi.rc Sun Nov 4 17:57:57 2007
@@ -1,0 +1,7 @@
+
+
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION "DirectX API Driver\0"
+#define REACTOS_STR_INTERNAL_NAME "dxgapi\0"
+#define REACTOS_STR_ORIGINAL_FILENAME "dxgapi\0"
+#include <reactos/version.rc>
Propchange: branches/reactx/reactos/drivers/directx/dxapi/dxapi.rc
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/reactx/reactos/drivers/directx/dxapi/dxapi_driver.h
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxapi/dxapi_driver.h (added)
+++ branches/reactx/reactos/drivers/directx/dxapi/dxapi_driver.h Sun Nov 4 17:57:57 2007
@@ -1,0 +1,156 @@
+
+
+
+/* DDK/NDK/SDK Headers */
+/* DDK/NDK/SDK Headers */
+#include <ddk/ntddk.h>
+#include <ddk/ntddmou.h>
+#include <ddk/ntifs.h>
+#include <ddk/tvout.h>
+#include <ndk/ntndk.h>
+
+
+
+#include <stdarg.h>
+#include <windef.h>
+#include <winerror.h>
+#include <wingdi.h>
+#include <winddi.h>
+#include <winuser.h>
+#include <prntfont.h>
+#include <dde.h>
+#include <wincon.h>
+
+#include <ddk/ddkmapi.h>
+
+/* Prototypes */
+VOID DxGetVersionNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxCloseHandle(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxOpenDirectDraw(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxOpenSurface(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxOpenVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxGetKernelCaps(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxGetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxSetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxSetSkipPattern(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxGetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxSetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxLock(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxFlipOverlay(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxFlipVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxGetCurrentAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxGetPreviousAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxRegisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxUnregisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxGetPolarity(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxOpenVpCatureDevice(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxAddVpCaptureBuffer(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+VOID DxFlushVpCaptureBuffs(PVOID lpvInBuffer, PVOID lpvOutBuffer);
+
+/* Internal driver table being use as looking up table for correct size of structs */
+DWORD tblCheckInBuffer [] =
+{
+ /* DD_DXAPI_GETVERSIONNUMBER */
+ 0,
+ /* DD_DXAPI_CLOSEHANDLE */
+ sizeof(DDCLOSEHANDLE),
+ 0, // DD_DXAPI_OPENDIRECTDRAW
+ 0, // DD_DXAPI_OPENSURFACE
+ 0, // DD_DXAPI_OPENVIDEOPORT
+ 0, // DD_DXAPI_GETKERNELCAPS
+ 0, // DD_DXAPI_GET_VP_FIELD_NUMBER
+ 0, // DD_DXAPI_SET_VP_FIELD_NUMBER
+ 0, // DD_DXAPI_SET_VP_SKIP_FIELD
+ 0, // DD_DXAPI_GET_SURFACE_STATE
+ 0, // DD_DXAPI_SET_SURFACE_STATE
+ 0, // DD_DXAPI_LOCK
+ /* DD_DXAPI_FLIP_OVERLAY */
+ sizeof(DDFLIPOVERLAY),
+ /* DD_DXAPI_FLIP_VP */
+ sizeof(DDFLIPVIDEOPORT),
+ /* DD_DXAPI_GET_CURRENT_VP_AUTOFLIP_SURFACE */
+ sizeof(DDGETAUTOFLIPIN),
+ /* DD_DXAPI_GET_LAST_VP_AUTOFLIP_SURFACE */
+ sizeof(DDGETAUTOFLIPIN),
+ /* DD_DXAPI_REGISTER_CALLBACK */
+ sizeof(DDREGISTERCALLBACK),
+ /* DD_DXAPI_UNREGISTER_CALLBACK */
+ sizeof(DDREGISTERCALLBACK),
+ /* DD_DXAPI_GET_POLARITY */
+ sizeof(DDGETPOLARITYIN),
+ /* DD_DXAPI_OPENVPCAPTUREDEVICE */
+ sizeof(DDOPENVPCAPTUREDEVICEIN),
+ /* DD_DXAPI_ADDVPCAPTUREBUFFER */
+ sizeof(DDADDVPCAPTUREBUFF),
+ /* DD_DXAPI_FLUSHVPCAPTUREBUFFERS */
+ sizeof(HANDLE)
+};
+
+DWORD tblCheckOutBuffer [] =
+{
+ /* DD_DXAPI_GETVERSIONNUMBER */
+ sizeof(DDGETVERSIONNUMBER),
+ /* DD_DXAPI_CLOSEHANDLE */
+ sizeof(DWORD),
+ 0, // DD_DXAPI_OPENDIRECTDRAW
+ 0, // DD_DXAPI_OPENSURFACE
+ 0, // DD_DXAPI_OPENVIDEOPORT
+ 0, // DD_DXAPI_GETKERNELCAPS
+ 0, // DD_DXAPI_GET_VP_FIELD_NUMBER
+ 0, // DD_DXAPI_SET_VP_FIELD_NUMBER
+ 0, // DD_DXAPI_SET_VP_SKIP_FIELD
+ 0, // DD_DXAPI_GET_SURFACE_STATE
+ 0, // DD_DXAPI_SET_SURFACE_STATE
+ 0, // DD_DXAPI_LOCK
+ /* DD_DXAPI_FLIP_OVERLAY */
+ sizeof(DWORD),
+ /* DD_DXAPI_FLIP_VP */
+ sizeof(DWORD),
+ /* DD_DXAPI_GET_CURRENT_VP_AUTOFLIP_SURFACE */
+ sizeof(DDGETAUTOFLIPOUT),
+ /* DD_DXAPI_GET_LAST_VP_AUTOFLIP_SURFACE */
+ sizeof(DDGETAUTOFLIPOUT),
+ /* DD_DXAPI_REGISTER_CALLBACK */
+ sizeof(DWORD),
+ /* DD_DXAPI_UNREGISTER_CALLBACK */
+ sizeof(DWORD),
+ /* DD_DXAPI_GET_POLARITY */
+ sizeof(DDGETPOLARITYOUT),
+ /* DD_DXAPI_OPENVPCAPTUREDEVICE */
+ sizeof(DDOPENVPCAPTUREDEVICEOUT),
+ /* DD_DXAPI_ADDVPCAPTUREBUFFER */
+ sizeof(DWORD),
+ /* DD_DXAPI_FLUSHVPCAPTUREBUFFERS */
+ sizeof(DWORD)
+};
+
+
+/* Internal driver function */
+DRVFN gDxApiEntryPoint [] =
+{
+ {DD_DXAPI_GETVERSIONNUMBER - DD_FIRST_DXAPI, (PFN) DxGetVersionNumber},
+ {DD_DXAPI_CLOSEHANDLE - DD_FIRST_DXAPI, (PFN) DxCloseHandle},
+ {DD_DXAPI_OPENDIRECTDRAW - DD_FIRST_DXAPI, (PFN) DxOpenDirectDraw},
+ {DD_DXAPI_OPENSURFACE - DD_FIRST_DXAPI, (PFN) DxOpenSurface},
+ {DD_DXAPI_OPENVIDEOPORT - DD_FIRST_DXAPI, (PFN) DxOpenVideoPort},
+ {DD_DXAPI_GETKERNELCAPS - DD_FIRST_DXAPI, (PFN) DxGetKernelCaps},
+ {DD_DXAPI_GET_VP_FIELD_NUMBER - DD_FIRST_DXAPI, (PFN) DxGetFieldNumber},
+ {DD_DXAPI_SET_VP_FIELD_NUMBER - DD_FIRST_DXAPI, (PFN) DxSetFieldNumber},
+ {DD_DXAPI_SET_VP_SKIP_FIELD - DD_FIRST_DXAPI, (PFN) DxSetSkipPattern},
+ {DD_DXAPI_GET_SURFACE_STATE - DD_FIRST_DXAPI, (PFN) DxGetSurfaceState},
+ {DD_DXAPI_SET_SURFACE_STATE - DD_FIRST_DXAPI, (PFN) DxSetSurfaceState},
+ {DD_DXAPI_LOCK - DD_FIRST_DXAPI, (PFN) DxLock},
+ {DD_DXAPI_FLIP_OVERLAY - DD_FIRST_DXAPI, (PFN) DxFlipOverlay},
+ {DD_DXAPI_FLIP_VP - DD_FIRST_DXAPI, (PFN) DxFlipVideoPort},
+ {DD_DXAPI_GET_CURRENT_VP_AUTOFLIP_SURFACE - DD_FIRST_DXAPI, (PFN)
DxGetCurrentAutoflip},
+ {DD_DXAPI_GET_LAST_VP_AUTOFLIP_SURFACE - DD_FIRST_DXAPI, (PFN)
DxGetPreviousAutoflip},
+ {DD_DXAPI_REGISTER_CALLBACK - DD_FIRST_DXAPI, (PFN) DxRegisterEvent},
+ {DD_DXAPI_UNREGISTER_CALLBACK - DD_FIRST_DXAPI, (PFN) DxUnregisterEvent},
+ {DD_DXAPI_GET_POLARITY - DD_FIRST_DXAPI, (PFN) DxGetPolarity},
+ {DD_DXAPI_OPENVPCAPTUREDEVICE - DD_FIRST_DXAPI, (PFN) DxOpenVpCatureDevice},
+ {DD_DXAPI_ADDVPCAPTUREBUFFER - DD_FIRST_DXAPI, (PFN) DxAddVpCaptureBuffer},
+ {DD_DXAPI_FLUSHVPCAPTUREBUFFERS - DD_FIRST_DXAPI, (PFN) DxFlushVpCaptureBuffs}
+};
+
+
+
Propchange: branches/reactx/reactos/drivers/directx/dxapi/dxapi_driver.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/reactx/reactos/drivers/directx/dxapi/main.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxapi/main.c (added)
+++ branches/reactx/reactos/drivers/directx/dxapi/main.c Sun Nov 4 17:57:57 2007
@@ -1,0 +1,232 @@
+
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS kernel
+ * PURPOSE: Native driver for dxg implementation
+ * FILE: drivers/directx/dxg/main.c
+ * PROGRAMER: Magnus olsen (magnus(a)greatlord.com)
+ * REVISION HISTORY:
+ * 15/10-2007 Magnus Olsen
+ */
+
+
+
+/* DDK/NDK/SDK Headers */
+/* DDK/NDK/SDK Headers */
+#include <ddk/ntddk.h>
+#include <ddk/ntddmou.h>
+#include <ddk/ntifs.h>
+#include <ddk/tvout.h>
+#include <ndk/ntndk.h>
+
+
+
+#include <stdarg.h>
+#include <windef.h>
+#include <winerror.h>
+#include <wingdi.h>
+#include <winddi.h>
+#include <winuser.h>
+#include <prntfont.h>
+#include <dde.h>
+#include <wincon.h>
+
+#include <ddk/ddkmapi.h>
+#include "dxapi_driver.h"
+
+
+
+
+NTSTATUS
+DriverEntry(IN PVOID Context1,
+ IN PVOID Context2)
+{
+ /*
+ * NOTE this driver will never be load, it only contain export list
+ * to win32k eng functions
+ */
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+GsDriverEntry(IN PVOID Context1,
+ IN PVOID Context2)
+{
+ return DriverEntry(Context1, Context2);
+}
+
+
+
+ULONG
+DxApiGetVersion()
+{
+ /* MSDN say this always return Direct Sound version 4.02 */
+ return 0x402;
+}
+
+
+/* protype from dxapi.h and ddkmapi.h from ddk, MSDN does not provide protype for this
api, only which
+ * functions it support, if u search in msdn you found full documations for each function
+ * for each functions.
+ */
+
+DWORD
+DxApi(ULONG dwFunctionNum,
+ PVOID lpvInBuffer,
+ ULONG cbInBuffer,
+ PVOID lpvOutBuffer,
+ ULONG cbOutBuffer)
+{
+
+ dwFunctionNum -= DD_FIRST_DXAPI;
+
+ if ((lpvOutBuffer == NULL) ||
+ (dwFunctionNum < (DD_FIRST_DXAPI - DD_FIRST_DXAPI)) ||
+ (dwFunctionNum > (DD_DXAPI_FLUSHVPCAPTUREBUFFERS - DD_FIRST_DXAPI)) ||
+ (gDxApiEntryPoint[dwFunctionNum].pfn == NULL) ||
+ (cbInBuffer != tblCheckInBuffer[dwFunctionNum]) ||
+ (cbOutBuffer != tblCheckOutBuffer[dwFunctionNum]))
+
+ {
+ return 0;
+ }
+
+ gDxApiEntryPoint[dwFunctionNum].pfn(lpvInBuffer, lpvOutBuffer);
+
+ return 0;
+}
+
+VOID
+DxGetVersionNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxCloseHandle(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxOpenDirectDraw(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxOpenSurface(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxOpenVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxGetKernelCaps(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxGetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxSetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxSetSkipPattern(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxGetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxSetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxLock(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxFlipOverlay(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxFlipVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxGetCurrentAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxGetPreviousAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxRegisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxUnregisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxGetPolarity(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxOpenVpCatureDevice(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxAddVpCaptureBuffer(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+VOID
+DxFlushVpCaptureBuffs(PVOID lpvInBuffer, PVOID lpvOutBuffer)
+{
+ /* FIXME Unimplement */
+}
+
+
+
Propchange: branches/reactx/reactos/drivers/directx/dxapi/main.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/reactx/reactos/drivers/directx/dxgthk/main.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxgthk/main.c (original)
+++ branches/reactx/reactos/drivers/directx/dxgthk/main.c Sun Nov 4 17:57:57 2007
@@ -20,7 +20,7 @@
* NOTE this driver will never be load, it only contain export list
* to win32k eng functions
*/
- return 0;
+ return STATUS_SUCCESS;
}