ReactOS 0.4.16-dev-297-gc569aee
ksuser.c File Reference
#include "ksuser.h"
#include <debug.h>
Include dependency graph for ksuser.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI KsiCreateObjectType (HANDLE hHandle, LPWSTR ObjectType, PVOID Buffer, ULONG BufferSize, ACCESS_MASK DesiredAccess, PHANDLE phHandle)
 
KSDDKAPI DWORD NTAPI KsCreateAllocator (HANDLE ConnectionHandle, PKSALLOCATOR_FRAMING AllocatorFraming, PHANDLE AllocatorHandle)
 
KSDDKAPI DWORD NTAPI KsCreateClock (HANDLE ConnectionHandle, PKSCLOCK_CREATE ClockCreate, PHANDLE ClockHandle)
 
KSDDKAPI DWORD NTAPI KsCreatePin (HANDLE FilterHandle, PKSPIN_CONNECT Connect, ACCESS_MASK DesiredAccess, PHANDLE ConnectionHandle)
 
KSDDKAPI DWORD NTAPI KsCreateTopologyNode (HANDLE ParentHandle, PKSNODE_CREATE NodeCreate, IN ACCESS_MASK DesiredAccess, OUT PHANDLE NodeHandle)
 
BOOL APIENTRY DllMain (HANDLE hModule, DWORD ulreason, LPVOID lpReserved)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file ksuser.c.

Function Documentation

◆ DllMain()

BOOL APIENTRY DllMain ( HANDLE  hModule,
DWORD  ulreason,
LPVOID  lpReserved 
)

Definition at line 256 of file ksuser.c.

257{
258 switch (ulreason)
259 {
264 break;
265 }
266
267 return TRUE;
268}
#define TRUE
Definition: types.h:120
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define DLL_THREAD_ATTACH
Definition: compat.h:132

◆ KsCreateAllocator()

KSDDKAPI DWORD NTAPI KsCreateAllocator ( HANDLE  ConnectionHandle,
PKSALLOCATOR_FRAMING  AllocatorFraming,
PHANDLE  AllocatorHandle 
)

Definition at line 107 of file ksuser.c.

111{
115 sizeof(KSALLOCATOR_FRAMING),
118}
#define GENERIC_READ
Definition: compat.h:135
#define KSSTRING_Allocator
Definition: ks.h:50
_In_ PKSALLOCATOR_FRAMING AllocatorFraming
Definition: ks.h:4518
_In_ PKSPIN_CONNECT _In_ ACCESS_MASK _Out_ PHANDLE ConnectionHandle
Definition: ks.h:4538
_In_ PKSALLOCATOR_FRAMING _Out_ PHANDLE AllocatorHandle
Definition: ks.h:4519
NTSTATUS NTAPI KsiCreateObjectType(HANDLE hHandle, LPWSTR ObjectType, PVOID Buffer, ULONG BufferSize, ACCESS_MASK DesiredAccess, PHANDLE phHandle)
Definition: ksuser.c:15

Referenced by CKsAllocator::KsCreateAllocatorAndGetHandle().

◆ KsCreateClock()

KSDDKAPI DWORD NTAPI KsCreateClock ( HANDLE  ConnectionHandle,
PKSCLOCK_CREATE  ClockCreate,
PHANDLE  ClockHandle 
)

Definition at line 145 of file ksuser.c.

148{
152 sizeof(KSCLOCK_CREATE),
155}
_In_ PKSCLOCK_CREATE ClockCreate
Definition: ks.h:4527
_In_ PKSCLOCK_CREATE _Out_ PHANDLE ClockHandle
Definition: ks.h:4528
#define KSSTRING_Clock
Definition: ks.h:49

Referenced by CKsProxy::CreateClockInstance().

◆ KsCreatePin()

KSDDKAPI DWORD NTAPI KsCreatePin ( HANDLE  FilterHandle,
PKSPIN_CONNECT  Connect,
ACCESS_MASK  DesiredAccess,
PHANDLE  ConnectionHandle 
)

Definition at line 192 of file ksuser.c.

196{
199
200 BufferSize += DataFormat->FormatSize;
201
202 return KsiCreateObjectType(FilterHandle,
204 Connect,
208
209}
KSDATAFORMAT * PKSDATAFORMAT
#define KSSTRING_Pin
Definition: ks.h:48
_In_ PKSPIN_CONNECT Connect
Definition: ks.h:4536
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254

Referenced by CreateMixerPinAndSetFormat(), CreatePinCallback(), CInputPin::CreatePinHandle(), COutputPin::CreatePinHandle(), InstantiatePins(), MMixerOpenMidiPin(), MMixerOpenWavePin(), OpenPin(), and TestKs().

◆ KsCreateTopologyNode()

KSDDKAPI DWORD NTAPI KsCreateTopologyNode ( HANDLE  ParentHandle,
PKSNODE_CREATE  NodeCreate,
IN ACCESS_MASK  DesiredAccess,
OUT PHANDLE  NodeHandle 
)

Definition at line 240 of file ksuser.c.

244{
245 return KsiCreateObjectType( ParentHandle,
248 sizeof(KSNODE_CREATE),
250 NodeHandle);
251}
_In_ PKSNODE_CREATE NodeCreate
Definition: ks.h:4546
_In_ PKSNODE_CREATE _In_ ACCESS_MASK _Out_ PHANDLE NodeHandle
Definition: ks.h:4548
#define KSSTRING_TopologyNode
Definition: ks.h:52

Referenced by CKsNode_Constructor().

◆ KsiCreateObjectType()

NTSTATUS NTAPI KsiCreateObjectType ( HANDLE  hHandle,
LPWSTR  ObjectType,
PVOID  Buffer,
ULONG  BufferSize,
ACCESS_MASK  DesiredAccess,
PHANDLE  phHandle 
)

Definition at line 15 of file ksuser.c.

21{
24 SIZE_T TotalSize;
25 LPWSTR pStr;
29
30 /* get length of object type */
32
33 /* get length for request */
34 TotalSize = (Length * sizeof(WCHAR)) + BufferSize;
35
36 /* append space for '\\'*/
37 TotalSize += sizeof(WCHAR);
38
39 /* allocate buffer */
40 pStr = HeapAlloc(GetProcessHeap(), 0, TotalSize);
41 if (!pStr)
42 {
43 /* out of memory */
45 }
46
47 /* copy object type */
48 wcscpy(pStr, ObjectType);
49
50 /* append slash */
51 pStr[Length] = L'\\';
52
53 /* append parameters */
54 memcpy(&pStr[Length+1], Buffer, BufferSize);
55
56 /* initialize object name */
57 ObjectName.Buffer = pStr;
58 ObjectName.Length = ObjectName.MaximumLength = TotalSize;
59
60 /* initialize object attributes */
62
63 /* create the object */
65
66 /* free buffer */
67 HeapFree(GetProcessHeap(), 0, pStr);
68
69 /* check for success */
70 if (!NT_SUCCESS(Status))
71 {
72 /* failed zero handle */
73 *phHandle = INVALID_HANDLE_VALUE;
74
75 /* convert error code */
77 }
78
79 /* done */
80 return Status;
81}
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define BufferSize
Definition: mmc.h:75
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define GetProcessHeap()
Definition: compat.h:736
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
Status
Definition: gdiplustypes.h:25
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ObjectType
Definition: metafile.c:81
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
ULONG_PTR SIZE_T
Definition: typedefs.h:80
_In_ PVOID _Out_opt_ PULONG_PTR _Outptr_opt_ PCUNICODE_STRING * ObjectName
Definition: cmfuncs.h:64
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by KsCreateAllocator(), KsCreateClock(), KsCreatePin(), and KsCreateTopologyNode().