ReactOS  0.4.14-dev-41-g31d7680
kcom.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define STATIC_KoCreateObject   0x72CF721CL, 0x525A, 0x11D1, {0x9A, 0xA1, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
 
#define KOSTRING_CreateObject   L"{72CF721C-525A-11D1-9AA1-00A0C9223196}"
 
#define CLSCTX_KERNEL_SERVER   0x00000200
 
#define STATIC_IID_IKoInitializeParentDeviceObject   0x21B36996, 0x8DE3, 0x11D1, 0x8A, 0xE0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96
 
#define COMDDKMETHOD   DECLSPEC_IMPORT
 
#define COMDDKAPI   DECLSPEC_IMPORT
 
#define INTERFACE   INonDelegatedUnknown
 
#define INTERFACE   IIndirectedUnknown
 
#define INTERFACE   IKoInitializeParentDeviceObject
 

Typedefs

typedef NTSTATUS(* KoCreateObjectHandler) (IN REFCLSID ClassId, IN IUnknown *UnkOuter OPTIONAL, IN REFIID InterfaceId, OUT PVOID *Interface)
 

Functions

 DEFINE_GUIDSTRUCT ("72CF721C-525A-11D1-9AA1-00A0C9223196", KoCreateObject)
 
 DEFINE_GUIDEX (IID_IKoInitializeParentDeviceObject)
 
 DECLARE_INTERFACE (INonDelegatedUnknown)
 
 DECLARE_INTERFACE (IIndirectedUnknown)
 
 DECLARE_INTERFACE_ (IKoInitializeParentDeviceObject, IUnknown)
 
COMDDKAPI void NTAPI KoRelease (IN REFCLSID ClassId)
 
COMDDKAPI NTSTATUS NTAPI KoCreateInstance (IN REFCLSID ClassId, IN IUnknown *UnkOuter OPTIONAL, IN ULONG ClsContext, IN REFIID InterfaceId, OUT PVOID *Interface)
 
COMDDKAPI NTSTATUS NTAPI KoDeviceInitialize (IN PDEVICE_OBJECT DeviceObject)
 
COMDDKAPI NTSTATUS NTAPI KoDriverInitialize (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPathName, IN KoCreateObjectHandler CreateObjectHandler)
 

Macro Definition Documentation

◆ CLSCTX_KERNEL_SERVER

#define CLSCTX_KERNEL_SERVER   0x00000200

Definition at line 37 of file kcom.h.

◆ COMDDKAPI

#define COMDDKAPI   DECLSPEC_IMPORT

Definition at line 62 of file kcom.h.

◆ COMDDKMETHOD

#define COMDDKMETHOD   DECLSPEC_IMPORT

Definition at line 55 of file kcom.h.

◆ INTERFACE [1/3]

#define INTERFACE   INonDelegatedUnknown

Definition at line 110 of file kcom.h.

◆ INTERFACE [2/3]

#define INTERFACE   IIndirectedUnknown

Definition at line 110 of file kcom.h.

◆ INTERFACE [3/3]

#define INTERFACE   IKoInitializeParentDeviceObject

Definition at line 110 of file kcom.h.

◆ KOSTRING_CreateObject

#define KOSTRING_CreateObject   L"{72CF721C-525A-11D1-9AA1-00A0C9223196}"

Definition at line 34 of file kcom.h.

◆ STATIC_IID_IKoInitializeParentDeviceObject

#define STATIC_IID_IKoInitializeParentDeviceObject   0x21B36996, 0x8DE3, 0x11D1, 0x8A, 0xE0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96

Definition at line 42 of file kcom.h.

◆ STATIC_KoCreateObject

#define STATIC_KoCreateObject   0x72CF721CL, 0x525A, 0x11D1, {0x9A, 0xA1, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}

Definition at line 32 of file kcom.h.

Typedef Documentation

◆ KoCreateObjectHandler

typedef NTSTATUS(* KoCreateObjectHandler) (IN REFCLSID ClassId, IN IUnknown *UnkOuter OPTIONAL, IN REFIID InterfaceId, OUT PVOID *Interface)

Definition at line 67 of file kcom.h.

Function Documentation

◆ DECLARE_INTERFACE() [1/2]

DECLARE_INTERFACE ( INonDelegatedUnknown  )

Definition at line 75 of file kcom.h.

75  {
76  STDMETHOD(NonDelegatedQueryInterface)(
77  THIS_
78  IN REFIID InterfaceId,
80  ) PURE;
81 
82  STDMETHOD_(ULONG,NonDelegatedAddRef)(
83  THIS
84  ) PURE;
85 
86  STDMETHOD_(ULONG,NonDelegatedRelease)(
87  THIS
88  ) PURE;
89 };
#define IN
Definition: typedefs.h:38
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
#define THIS
Definition: basetyps.h:66
#define STDMETHOD(m)
Definition: basetyps.h:62
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
#define PURE
Definition: basetyps.h:64
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DECLARE_INTERFACE() [2/2]

DECLARE_INTERFACE ( IIndirectedUnknown  )

Definition at line 93 of file kcom.h.

93  {
94  STDMETHOD(IndirectedQueryInterface)(
95  THIS_
96  IN REFIID InterfaceId,
98  ) PURE;
99 
100  STDMETHOD_(ULONG,IndirectedAddRef)(
101  THIS
102  ) PURE;
103 
104  STDMETHOD_(ULONG,IndirectedRelease)(
105  THIS
106  ) PURE;
107 };
#define IN
Definition: typedefs.h:38
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
#define THIS
Definition: basetyps.h:66
#define STDMETHOD(m)
Definition: basetyps.h:62
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
#define PURE
Definition: basetyps.h:64
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DECLARE_INTERFACE_()

DECLARE_INTERFACE_ ( IKoInitializeParentDeviceObject  ,
IUnknown   
)

Definition at line 111 of file kcom.h.

111  {
112  STDMETHOD(SetParentDeviceObject)(
113  THIS_
114  IN PDEVICE_OBJECT ParentDeviceObject
115  ) PURE;
116 };
#define IN
Definition: typedefs.h:38
#define THIS_
Definition: basetyps.h:65
#define STDMETHOD(m)
Definition: basetyps.h:62
#define PURE
Definition: basetyps.h:64

◆ DEFINE_GUIDEX()

DEFINE_GUIDEX ( IID_IKoInitializeParentDeviceObject  )

◆ DEFINE_GUIDSTRUCT()

DEFINE_GUIDSTRUCT ( "72CF721C-525A-11D1-9AA1-00A0C9223196"  ,
KoCreateObject   
)

◆ KoCreateInstance()

COMDDKAPI NTSTATUS NTAPI KoCreateInstance ( IN REFCLSID  ClassId,
IN IUnknown *UnkOuter  OPTIONAL,
IN ULONG  ClsContext,
IN REFIID  InterfaceId,
OUT PVOID Interface 
)

Definition at line 19 of file kcom.c.

25 {
26  /* If UnkOuter isn't NULL, it must be IUnknown - TODO: CHECK THIS PARAM */
27  /* TODO: Check IRQL? */
28 
29  DPRINT("KoCreateInstance called\n");
30 
31  if ( ClsContext != CLSCTX_KERNEL_SERVER )
32  {
33  DPRINT("KoCreateInstance: ClsContext must be CLSCTX_KERNEL_SERVER\n");
35  }
36 
37  if (IsEqualGUIDAligned(InterfaceId, &IID_IUnknown))
38  {
39  DPRINT("KoCreateInstance: InterfaceId cannot be IID_IUnknown\n");
41  }
42 
43 
44  /*
45  Find the desired interface and create an instance.
46 
47  But we also need to supply a
48  pointer which will be set to a list of available interfaces, to
49  IoGetDeviceInterfaces.
50 
51  We can then create a file based on this information and thus talk
52  to the appropriate device.
53 
54  Useful references:
55  http://www.freelists.org/archives/wdmaudiodev/01-2003/msg00023.html
56 
57  TODO
58  */
59 
60  DPRINT("** FAKING SUCCESS **\n");
61 
62  return STATUS_SUCCESS;
63 }
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
#define STATUS_INVALID_PARAMETER_3
Definition: ntstatus.h:463
void DPRINT(...)
Definition: polytest.cpp:61
#define CLSCTX_KERNEL_SERVER
Definition: kcom.h:37
const GUID IID_IUnknown
Definition: kcom.c:15
#define STATUS_INVALID_PARAMETER_4
Definition: ntstatus.h:464
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ KoDeviceInitialize()

COMDDKAPI NTSTATUS NTAPI KoDeviceInitialize ( IN PDEVICE_OBJECT  DeviceObject)

Definition at line 1513 of file api.c.

1515 {
1516  PDEVICE_EXTENSION DeviceExtension;
1517 
1518  /* get device extension */
1519  DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
1520 
1522 }
NTSTATUS NTAPI KopDispatchCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:1360
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
KSDDKAPI NTSTATUS NTAPI KsAddObjectCreateItemToDeviceHeader(IN KSDEVICE_HEADER DevHeader, IN PDRIVER_DISPATCH Create, IN PVOID Context, IN PWCHAR ObjectClass, IN PSECURITY_DESCRIPTOR SecurityDescriptor)
Definition: api.c:798
#define KOSTRING_CreateObject
Definition: kcom.h:34
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
struct _BEEP_DEVICE_EXTENSION * PDEVICE_EXTENSION

◆ KoDriverInitialize()

COMDDKAPI NTSTATUS NTAPI KoDriverInitialize ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPathName,
IN KoCreateObjectHandler  CreateObjectHandler 
)

Definition at line 1530 of file api.c.

1534 {
1535  PKO_DRIVER_EXTENSION DriverObjectExtension;
1536  NTSTATUS Status;
1537 
1538  /* allocate driver object extension */
1540 
1541  /* did it work */
1542  if (NT_SUCCESS(Status))
1543  {
1544  /* store create handler */
1545  DriverObjectExtension->CreateObjectHandler = CreateObjectHandler;
1546 
1547  /* Setting our IRP handlers */
1551 
1552  /* The driver unload routine */
1554 
1555  /* The driver-supplied AddDevice */
1557 
1558  /* KS handles these */
1559  DPRINT1("Setting KS function handlers\n");
1563 
1564  }
1565 
1566  return Status;
1567 }
KSDDKAPI NTSTATUS NTAPI KsDefaultDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:166
KSDDKAPI NTSTATUS NTAPI KsDefaultDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:110
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1764
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
LONG NTSTATUS
Definition: precomp.h:26
KSDDKAPI VOID NTAPI KsNullDriverUnload(IN PDRIVER_OBJECT DriverObject)
Definition: irp.c:1145
NTSTATUS NTAPI KopAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
Definition: api.c:1441
KSDDKAPI NTSTATUS NTAPI KsSetMajorFunctionHandler(IN PDRIVER_OBJECT DriverObject, IN ULONG MajorFunction)
Definition: irp.c:2017
PDRIVER_EXTENSION DriverExtension
Definition: iotypes.h:2174
KoCreateObjectHandler CreateObjectHandler
Definition: kstypes.h:5
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MJ_POWER
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2180
#define IRP_MJ_SYSTEM_CONTROL
Status
Definition: gdiplustypes.h:24
PDRIVER_ADD_DEVICE AddDevice
Definition: iotypes.h:2112
KSDDKAPI NTSTATUS NTAPI KsDefaultForwardIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: api.c:227
COMDDKAPI NTSTATUS NTAPI KoDriverInitialize(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPathName, IN KoCreateObjectHandler CreateObjectHandler)
Definition: api.c:1530
#define DPRINT1
Definition: precomp.h:8
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2181
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

Referenced by KoDriverInitialize(), and KopDispatchCreate().

◆ KoRelease()

COMDDKAPI void NTAPI KoRelease ( IN REFCLSID  ClassId)

Definition at line 1575 of file api.c.

1577 {
1578 
1579 }