ReactOS 0.4.16-dev-250-g3ecd236
deviceinterface.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for deviceinterface.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS KspSetDeviceInterfacesState (IN PLIST_ENTRY ListHead, IN BOOL Enable)
 
NTSTATUS KspFreeDeviceInterfaces (IN PLIST_ENTRY ListHead)
 
NTSTATUS KspRegisterDeviceInterfaces (IN PDEVICE_OBJECT PhysicalDeviceObject, IN ULONG CategoriesCount, IN GUID const *Categories, IN PUNICODE_STRING ReferenceString, OUT PLIST_ENTRY SymbolicLinkList)
 
NTSTATUS KspSetFilterFactoriesState (IN PKSIDEVICE_HEADER DeviceHeader, IN BOOLEAN NewState)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 3 of file deviceinterface.c.

Function Documentation

◆ KspFreeDeviceInterfaces()

NTSTATUS KspFreeDeviceInterfaces ( IN PLIST_ENTRY  ListHead)

Definition at line 37 of file deviceinterface.c.

39{
41 PSYMBOLIC_LINK_ENTRY SymEntry;
42
43 while(!IsListEmpty(ListHead))
44 {
45 /* remove first entry */
46 Entry = RemoveHeadList(ListHead);
47
48 /* fetch symbolic link entry */
50
51 /* free device interface string */
53 /* free entry item */
55 }
56
57 return STATUS_SUCCESS;
58}
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
VOID FreeItem(IN PVOID Item)
Definition: misc.c:37
struct SYMBOLIC_LINK_ENTRY * PSYMBOLIC_LINK_ENTRY
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define STATUS_SUCCESS
Definition: shellext.h:65
base of all file and directory entries
Definition: entries.h:83
Definition: kstypes.h:122
UNICODE_STRING SymbolicLink
Definition: kstypes.h:124
Definition: typedefs.h:120
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by IKsFilterFactory_fnRelease().

◆ KspRegisterDeviceInterfaces()

NTSTATUS KspRegisterDeviceInterfaces ( IN PDEVICE_OBJECT  PhysicalDeviceObject,
IN ULONG  CategoriesCount,
IN GUID const Categories,
IN PUNICODE_STRING  ReferenceString,
OUT PLIST_ENTRY  SymbolicLinkList 
)

Definition at line 61 of file deviceinterface.c.

67{
70 PSYMBOLIC_LINK_ENTRY SymEntry;
71
72 for(Index = 0; Index < CategoriesCount; Index++)
73 {
74 /* allocate a symbolic link entry */
76 /* check for success */
77 if (!SymEntry)
79
80 /* now register device interface */
84 &SymEntry->SymbolicLink);
85
86 if (!NT_SUCCESS(Status))
87 {
88 DPRINT1("Failed to register device interface %x\n", Status);
89
90 /* free entry */
91 FreeItem(SymEntry);
92
93 /* return result */
94 return Status;
95 }
96
97 /* copy device class */
99
100 /* insert symbolic link entry */
102 }
103
104 /* return result */
105 return Status;
106}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1157
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define InsertTailList(ListHead, Entry)
#define NonPagedPool
Definition: env_spec_w32.h:307
Status
Definition: gdiplustypes.h:25
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:29
NTSTATUS NTAPI IoRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject, IN CONST GUID *InterfaceClassGuid, IN PUNICODE_STRING ReferenceString OPTIONAL, OUT PUNICODE_STRING SymbolicLinkName)
Definition: deviface.c:955
const GUID Categories[]
Definition: splitter.c:208
LIST_ENTRY Entry
Definition: kstypes.h:123
CLSID DeviceInterfaceClass
Definition: kstypes.h:125
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ CONST GUID _In_opt_ PCUNICODE_STRING ReferenceString
Definition: wdfdevice.h:3630
_In_opt_ PDEVICE_OBJECT _In_ ULONG _Outptr_result_nullonfailure_ _At_ * SymbolicLinkList(return==0, __drv_allocatesMem(Mem))) PZZWSTR *SymbolicLinkList

Referenced by IKsFilterFactory_fnInitialize().

◆ KspSetDeviceInterfacesState()

NTSTATUS KspSetDeviceInterfacesState ( IN PLIST_ENTRY  ListHead,
IN BOOL  Enable 
)

Definition at line 7 of file deviceinterface.c.

10{
13 PSYMBOLIC_LINK_ENTRY SymEntry;
14
15
16 Entry = ListHead->Flink;
17 while(Entry != ListHead)
18 {
19 /* fetch symbolic link entry */
21 /* set device interface state */
23
24 DPRINT("KspSetDeviceInterfacesState SymbolicLink '%S' Status %lx\n", SymEntry->SymbolicLink.Buffer, Status, Enable);
25
26 /* check for success */
27 if (!NT_SUCCESS(Status))
28 return Status;
29 /* get next entry */
30 Entry = Entry->Flink;
31 }
32 /* return result */
33 return Status;
34}
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
NTSTATUS NTAPI IoSetDeviceInterfaceState(IN PUNICODE_STRING SymbolicLinkName, IN BOOLEAN Enable)
Definition: deviface.c:1311
#define DPRINT
Definition: sndvol32.h:73

Referenced by IKsFilterFactory_fnRelease(), and IKsFilterFactory_fnSetDeviceClassesState().

◆ KspSetFilterFactoriesState()

NTSTATUS KspSetFilterFactoriesState ( IN PKSIDEVICE_HEADER  DeviceHeader,
IN BOOLEAN  NewState 
)

Definition at line 109 of file deviceinterface.c.

112{
113 PCREATE_ITEM_ENTRY CreateEntry;
116
117 /* grab first device interface */
118 Entry = DeviceHeader->ItemList.Flink;
119 while(Entry != &DeviceHeader->ItemList && Status == STATUS_SUCCESS)
120 {
121 /* grab create entry */
123
124 /* sanity check */
125 ASSERT(CreateEntry->CreateItem);
126
127 if (CreateEntry->CreateItem->Create == IKsFilterFactory_Create)
128 {
129 /* found our own filterfactory */
130 Status = KsFilterFactorySetDeviceClassesState((PKSFILTERFACTORY)CreateEntry->CreateItem->Context, NewState);
131 }
132
133 Entry = Entry->Flink;
134 }
135
136 /* store result */
137 return Status;
138}
NTSTATUS NTAPI IKsFilterFactory_Create(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: filterfactory.c:42
KSDDKAPI NTSTATUS NTAPI KsFilterFactorySetDeviceClassesState(IN PKSFILTERFACTORY FilterFactory, IN BOOLEAN NewState)
#define ASSERT(a)
Definition: mode.c:44
Definition: kstypes.h:46
PKSOBJECT_CREATE_ITEM CreateItem
Definition: kstypes.h:48

Referenced by IKsDevice_PnpPostStart(), and IKsDevice_PnpStartDevice().