From d05c0eadf6ac03769365330584439ea02c2441c5 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Fri, 9 Nov 2007 17:33:02 +0000 Subject: [PATCH] Update the documentation adding lite more code svn path=/branches/reactx/; revision=30301 --- reactos/dll/directx/ksuser/ksuser.c | 65 ++++++++++++++++++----------- reactos/dll/directx/ksuser/ksuser.h | 1 + 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/reactos/dll/directx/ksuser/ksuser.c b/reactos/dll/directx/ksuser/ksuser.c index b16d188b0b3..caf91592534 100644 --- a/reactos/dll/directx/ksuser/ksuser.c +++ b/reactos/dll/directx/ksuser/ksuser.c @@ -20,17 +20,16 @@ KsiCreateObjectType( HANDLE hHandle, /*++ * @name KsCreateAllocator * @implemented +* The function KsCreateAllocator creates a handle to an allocator for the given sink connection handle * -* The function KsCreateAllocator +* @param HANDLE ConnectionHandle +* Handle to the sink connection on which to create the allocator * -* @param +* @param PKSALLOCATOR_FRAMING AllocatorFraming +* the input param we using to alloc our framing * -* @param -* -* @param ACCESS_MASK DesiredAccess -* Desrided access -* -* @param +* @param PHANDLE AllocatorHandle +* Our new handle that we have alloc * * @return * Return NTSTATUS error code or sussess code. @@ -59,16 +58,16 @@ KsCreateAllocator(HANDLE ConnectionHandle, * @name KsCreateClock * @implemented * -* The function KsCreateClock +* The function KsCreateClock creates handle to clock instance * -* @param +* @param HANDLE ConnectionHandle +* Handle to use to create the clock * -* @param +* @param PKSCLOCK_CREATE ClockCreate +* paramenter to use to create the clock * -* @param ACCESS_MASK DesiredAccess -* Desrided access -* -* @param +* @param PHANDLE ClockHandle +* The new handle * * @return * Return NTSTATUS error code or sussess code. @@ -92,42 +91,58 @@ KsCreateClock(HANDLE ConnectionHandle, ClockHandle); } - - /*++ * @name KsCreatePin * @implemented * -* The function KsCreatePin +* The function KsCreatePin passes a connection request to device and create pin instance * -* @param -* -* @param +* @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 +* @param PHANDLE ConnectionHandle +* connection handle passed * * @return * Return NTSTATUS error code or sussess code. * * @remarks. -* none +* 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, - OUT PHANDLE ConnectionHandle) + 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, - sizeof(KSPIN_CONNECT), + BufferSize, DesiredAccess, ConnectionHandle); diff --git a/reactos/dll/directx/ksuser/ksuser.h b/reactos/dll/directx/ksuser/ksuser.h index 5e034765aa2..c07174eeb09 100644 --- a/reactos/dll/directx/ksuser/ksuser.h +++ b/reactos/dll/directx/ksuser/ksuser.h @@ -3,6 +3,7 @@ #define _KSDDK_ #include +#include #ifndef NTSTATUS #define NTSTATUS DWORD