Author: greatlrd
Date: Thu Apr 17 13:01:51 2008
New Revision: 33006
URL:
http://svn.reactos.org/svn/reactos?rev=33006&view=rev
Log:
merge ksuser.dll from reactx branch to trunk
not all api are implemented. reactx.h header are now in use here
Added:
trunk/reactos/dll/directx/ksuser/ksuser.h (with props)
Modified:
trunk/reactos/dll/directx/ksuser/ksuser.c
trunk/reactos/dll/directx/ksuser/ksuser.def
trunk/reactos/dll/directx/ksuser/ksuser.rbuild
trunk/reactos/dll/directx/ksuser/ksuser.rc
Modified: trunk/reactos/dll/directx/ksuser/ksuser.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksuser/ksuser.…
==============================================================================
--- trunk/reactos/dll/directx/ksuser/ksuser.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksuser/ksuser.c [iso-8859-1] Thu Apr 17 13:01:51 2008
@@ -1,7 +1,7 @@
/*
- * KSUSER.DLL - ReactOS User CSA Library
- *
- * Copyright 2008 Dmitry Chapyshev
+ * KSUSER.DLL - ReactOS
+ *
+ * Copyright 2008 Magnus Olsen and Dmitry Chapyshev
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -18,46 +18,210 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <windows.h>
-#include <stdio.h>
-#include <wchar.h>
-#include <tchar.h>
-#include <ks.h>
-
-KSDDKAPI NTSTATUS NTAPI
-KsCreateAllocator(
- HANDLE ConnectionHandle,
- PKSALLOCATOR_FRAMING AllocatorFraming,
- PHANDLE AllocatorHandle)
-{
- return STATUS_SUCCESS;
-}
-
-KSDDKAPI NTSTATUS NTAPI
-KsCreateClock(
- HANDLE ConnectionHandle,
- PKSCLOCK_CREATE ClockCreate,
- PHANDLE ClockHandle)
-{
- return STATUS_SUCCESS;
-}
-
-KSDDKAPI NTSTATUS NTAPI
-KsCreatePin(
- HANDLE FilterHandle,
- PKSPIN_CONNECT Connect,
- ACCESS_MASK DesiredAccess,
- PHANDLE ConnectionHandle)
-{
- return STATUS_SUCCESS;
-}
-
-KSDDKAPI NTSTATUS NTAPI
-KsCreateTopologyNode(
- HANDLE ParentHandle,
- PKSNODE_CREATE NodeCreate,
- ACCESS_MASK DesiredAccess,
- PHANDLE NodeHandle)
-{
- return STATUS_SUCCESS;
-}
+
+#include "ksuser.h"
+
+NTSTATUS NTAPI KsiCreateObjectType( HANDLE hHandle, PVOID guidstr, PVOID Buffer, ULONG
BufferSize, ACCESS_MASK DesiredAccess, PHANDLE phHandle);
+
+NTSTATUS
+NTAPI
+KsiCreateObjectType( HANDLE hHandle,
+ PVOID IID,
+ PVOID Buffer,
+ ULONG BufferSize,
+ ACCESS_MASK DesiredAccess,
+ PHANDLE phHandle)
+{
+ UNIMPLEMENTED
+ return 0;
+}
+
+/*++
+* @name KsCreateAllocator
+* @implemented
+* The function KsCreateAllocator creates a handle to an allocator for the given sink
connection handle
+*
+* @param HANDLE ConnectionHandle
+* Handle to the sink connection on which to create the allocator
+*
+* @param PKSALLOCATOR_FRAMING AllocatorFraming
+* the input param we using to alloc our framing
+*
+* @param PHANDLE AllocatorHandle
+* Our new handle that we have alloc
+*
+* @return
+* Return NTSTATUS error code or sussess code.
+*
+* @remarks.
+* none
+*
+*--*/
+KSDDKAPI
+NTSTATUS
+NTAPI
+KsCreateAllocator(HANDLE ConnectionHandle,
+ PKSALLOCATOR_FRAMING AllocatorFraming,
+ PHANDLE AllocatorHandle)
+
+{
+ return KsiCreateObjectType( ConnectionHandle,
+ KSSTRING_Allocator,
+ (PVOID) AllocatorFraming,
+ sizeof(KSALLOCATOR_FRAMING),
+ GENERIC_READ,
+ AllocatorHandle);
+}
+
+/*++
+* @name KsCreateClock
+* @implemented
+*
+* The function KsCreateClock creates handle to clock instance
+*
+* @param HANDLE ConnectionHandle
+* Handle to use to create the clock
+*
+* @param PKSCLOCK_CREATE ClockCreate
+* paramenter to use to create the clock
+*
+* @param PHANDLE ClockHandle
+* The new handle
+*
+* @return
+* Return NTSTATUS error code or sussess code.
+*
+* @remarks.
+* none
+*
+*--*/
+KSDDKAPI
+NTSTATUS
+NTAPI
+KsCreateClock(HANDLE ConnectionHandle,
+ PKSCLOCK_CREATE ClockCreate,
+ PHANDLE ClockHandle)
+{
+ return KsiCreateObjectType( ConnectionHandle,
+ KSSTRING_Clock,
+ (PVOID) ClockCreate,
+ sizeof(KSCLOCK_CREATE),
+ GENERIC_READ,
+ ClockHandle);
+}
+
+/*++
+* @name KsCreatePin
+* @implemented
+*
+* The function KsCreatePin passes a connection request to device and create pin instance
+*
+* @param HANDLE FilterHandle
+* handle of the filter initiating the create request
+*
+* @param PKSPIN_CONNECT Connect
+* Pointer to a KSPIN_CONNECT structure that contains parameters for the requested
connection.
+* This should be followed in memory by a KSDATAFORMAT data structure, describing the data
format
+* requested for the connection.
+
+* @param ACCESS_MASK DesiredAccess
+* Desrided access
+*
+* @param PHANDLE ConnectionHandle
+* connection handle passed
+*
+* @return
+* Return NTSTATUS error code or sussess code.
+*
+* @remarks.
+* The flag in PKSDATAFORMAT is not really document,
+* to find it u need api mointor allot api and figout
+* how it works, only flag I have found is the
+* KSDATAFORMAT_ATTRIBUTES flag, it doing a Align
+* of LONLONG size, it also round up it.
+*
+*--*/
+
+KSDDKAPI
+NTSTATUS
+NTAPI
+KsCreatePin(HANDLE FilterHandle,
+ PKSPIN_CONNECT Connect,
+ ACCESS_MASK DesiredAccess,
+ PHANDLE ConnectionHandle)
+{
+ ULONG BufferSize = sizeof(KSPIN_CONNECT);
+ PKSDATAFORMAT DataFormat = ((PKSDATAFORMAT) ( ((ULONG)Connect) +
((ULONG)sizeof(KSPIN_CONNECT)) ) );
+
+ if (DataFormat->Flags & KSDATAFORMAT_ATTRIBUTES)
+ {
+ BufferSize += (ROUND_UP(DataFormat->FormatSize,sizeof(LONGLONG)) +
DataFormat->FormatSize);
+ }
+
+ return KsiCreateObjectType(FilterHandle,
+ KSSTRING_Pin,
+ Connect,
+ BufferSize,
+ DesiredAccess,
+ ConnectionHandle);
+
+}
+
+/*++
+* @name KsCreateTopologyNode
+* @implemented
+*
+* The function KsCreateTopologyNode creates a handle to a topology node instance
+*
+* @param HANDLE ParentHandle
+* Handle to parent when want to use when we created the node on
+*
+*
+* @param PKSNODE_CREATE NodeCreate
+* topology node parameters to use when it is create
+*
+* @param ACCESS_MASK DesiredAccess
+* Desrided access
+*
+* @param PHANDLE NodeHandle
+* Location for the topology node handle
+*
+* @return
+* Return NTSTATUS error code or sussess code.
+*
+* @remarks.
+* none
+*
+*--*/
+KSDDKAPI
+NTSTATUS
+NTAPI
+KsCreateTopologyNode(HANDLE ParentHandle,
+ PKSNODE_CREATE NodeCreate,
+ IN ACCESS_MASK DesiredAccess,
+ OUT PHANDLE NodeHandle)
+{
+ return KsiCreateObjectType( ParentHandle,
+ KSSTRING_TopologyNode,
+ (PVOID) NodeCreate,
+ sizeof(KSNODE_CREATE),
+ DesiredAccess,
+ NodeHandle);
+}
+
+
+BOOL
+APIENTRY
+DllMain(HANDLE hModule, DWORD ulreason, LPVOID lpReserved)
+{
+ switch (ulreason)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+
+ return TRUE;
+}
Modified: trunk/reactos/dll/directx/ksuser/ksuser.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksuser/ksuser.…
==============================================================================
--- trunk/reactos/dll/directx/ksuser/ksuser.def [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksuser/ksuser.def [iso-8859-1] Thu Apr 17 13:01:51 2008
@@ -1,7 +1,6 @@
LIBRARY ksuser.dll
EXPORTS
-KsCreateAllocator
-KsCreateClock
-KsCreatePin
-KsCreateTopologyNode
-; EOF
+ KsCreateAllocator@12
+ KsCreateClock@12
+ KsCreatePin@16
+ KsCreateTopologyNode@16
Added: trunk/reactos/dll/directx/ksuser/ksuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksuser/ksuser.…
==============================================================================
--- trunk/reactos/dll/directx/ksuser/ksuser.h (added)
+++ trunk/reactos/dll/directx/ksuser/ksuser.h [iso-8859-1] Thu Apr 17 13:01:51 2008
@@ -1,0 +1,15 @@
+
+
+
+#define _KSDDK_
+#include <windows.h>
+#include <reactos/helper.h>
+
+
+
+#include <ks.h>
+#include <debug.h>
+
+
+
+
Propchange: trunk/reactos/dll/directx/ksuser/ksuser.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/ksuser/ksuser.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksuser/ksuser.…
==============================================================================
--- trunk/reactos/dll/directx/ksuser/ksuser.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksuser/ksuser.rbuild [iso-8859-1] Thu Apr 17 13:01:51 2008
@@ -1,15 +1,13 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
-<group>
<module name="ksuser" type="win32dll"
baseaddress="${BASEADDRESS_KSUSER}" installbase="system32"
installname="ksuser.dll" allowwarnings="true">
<importlibrary definition="ksuser.def" />
<include base="ksuser">.</include>
<define name="WINVER">0x600</define>
<define name="_WIN32_WINNT">0x600</define>
- <library>advapi32</library>
+ <library>advapi32</library>
<library>kernel32</library>
<library>ntdll</library>
<file>ksuser.c</file>
<file>ksuser.rc</file>
</module>
-</group>
Modified: trunk/reactos/dll/directx/ksuser/ksuser.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksuser/ksuser.…
==============================================================================
--- trunk/reactos/dll/directx/ksuser/ksuser.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksuser/ksuser.rc [iso-8859-1] Thu Apr 17 13:01:51 2008
@@ -1,12 +1,10 @@
+
#define REACTOS_VERSION_DLL
-#define REACTOS_STR_FILE_DESCRIPTION "ReactOS User CSA Library\0"
-#define REACTOS_STR_INTERNAL_NAME "ksuser\0"
+#define REACTOS_STR_FILE_DESCRIPTION "User CSA Library\0"
+#define REACTOS_STR_INTERNAL_NAME "ksuser.dll\0"
#define REACTOS_STR_ORIGINAL_FILENAME "ksuser.dll\0"
-#define REACTOS_FILEVERSION 5,3,0,900
-#define REACTOS_STR_FILE_VERSION "5.3.0.900"
-#define REACTOS_PRODUCTVERSION 5,3,0,900
-#define REACTOS_STR_PRODUCT_VERSION "5.3"
+#include <reactos/reactx.h>
#include <reactos/version.rc>