Hi,
This generic class is C++ class, not Microsoft class driver.
It is something like
class CBDevice
{
public:
…
PDEVICE_OBJECT m_pDevObj;
PDRIVER_OBJECT m_pDrvObj;
PVOID m_pParent;
};
And upon IRP_MJ_PNP/IR_MN_STATR_DEVICE you will know what device it is base
on PCI configration info from PDO and you can create a class
class MyDevice1
{
public:
MyDevice1(CBDevice* pChild) : m_pDev(pChild)
{
pChild->m_pParent = this;
}
…
CBDevice m_pDev;
};
You can specify an new operator. There was a C++ library for NT kernel
published in MSJ in 1996 by two Intel guys. You can use the new operator
such as
inline void * __cdecl operator new(size_t Size, POOL_TYPE PoolType, ULONG
tag)
{
return nSize ? ExAllocatePoolWithTag(PoolType, Size, tag) : NULL;
}
inline void __cdecl operator delete(void* p)
{
if (p)
ExFreePool(p);
}
found in the papaer.
In fact, you don’t have to use C++ at all. Using structures like the classes
will do.
Because the driver is written for my former employer, I can disclose generic
things as abov.
Good luck.
Bi
-----Original Message-----
From: Srikanth [mailto:xxxxx@yahoo.com]
Sent: Tuesday, September 24, 2002 8:46 PM
To: NT Developers Interest List
Subject: [ntdev] RE: which class is a driver for PCI image codec?
Hi,
What ever you have said is true. But how to write a generic class driver
when the device doesnot fall under any of the classes? Do I need to create
a new class and a minidriver or a new class alone will be sufficient?
Also, can the new class driver interact with a user mode application? Any
pointers to creation of new class will be highly appreciated.
Please clarify,
Thanks a lot!
Rgds
SRikanth
You are currently subscribed to ntdev as: xxxxx@appstream.com
To unsubscribe send a blank email to %%email.unsub%%