Obtain GUID of driver supplied by microsoft

Hi All,

Tim Roberts wrote:
“Write a filter driver that accepts your custom requests, insert it as an
upper filter to your PCI\VEN_8086&DEV_3A18, and off you go. You will
not use an INF. You will not use a GUID. You will not be present in
Device Manager.”

Can you explain how to install my driver as “upper filter” without INF ?

In toaster.c, the user gets fdoData->BusInterface by calling:
status = WdfFdoQueryForInterface(Device,
&GUID_TOASTER_INTERFACE_STANDARD,
(PINTERFACE) &fdoData->BusInterface,
sizeof(TOASTER_INTERFACE_STANDARD),
1,
NULL);// InterfaceSpecific Data

In the toaster sample, the define GUID_TOASTER_INTERFACE_STANDARD is used in the filter and also in the bus.
I guess in my case I will use a GUID not shared by other drivers.
Am I right ?

Thanks,
Zvika

I realize the slant of all the conversation is the literal how to get access to the LPC bridge device register set, but I am back to the question of the GPIO pins themselves.

Zvika, how are you getting access to the GPIO pins? Did the manufacturer of the CPU board give you access to them by bringing them to a connector of some kind?
Do you have a list of what GPIO are in use and for what purpose.

As was stated before, windows usually manages GPIO through ACPI code, so I am curious how you know which GPIO are available for your use or HOW you intend to connect to them?

Is this a design you have created?

Sincerely,
Tony

xxxxx@gmail.com wrote:

Tim Roberts wrote:
“Write a filter driver that accepts your custom requests, insert it as an
upper filter to your PCI\VEN_8086&DEV_3A18, and off you go. You will
not use an INF. You will not use a GUID. You will not be present in
Device Manager.”

Can you explain how to install my driver as “upper filter” without INF ?

Let me ask you the opposite question. How would you install it WITH an
INF? Remember the “toaster” sample installs a function driver PLUS a
filter. You want to add a filter to driver that already exists.

In the WDK samples, storage\filters\addfilter contains a generic example
of how to add an upper filter to a device that already exists. This
only tweaks the registry key; you still have to copy the file into place
and create a service for it. That can be done with a batch file.

In toaster.c, the user gets fdoData->BusInterface by calling:
status = WdfFdoQueryForInterface(Device,
&GUID_TOASTER_INTERFACE_STANDARD,
(PINTERFACE) &fdoData->BusInterface,
sizeof(TOASTER_INTERFACE_STANDARD),
1,
NULL);// InterfaceSpecific Data

In the toaster sample, the define GUID_TOASTER_INTERFACE_STANDARD is used in the filter and also in the bus.
I guess in my case I will use a GUID not shared by other drivers.
Am I right ?

No. You will not use WdfFdoQueryForInterface at all. That whole
mechanism is used for communication between drivers.

You DO need to figure out how to let your user-mode clients find you.
For that, you might very well use a device interface, and that does need
a GUID.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Tim,

I tried :
addfilter.exe /add wdfsimple.sys /device “pci\ven_8086&dev_3a18”

and got:
No devices matched that name

What is the parameter “device” in my case ?

Your help is highly appreciated,
Zvika

-----Original Message-----
From: Tim Roberts
Sent: Friday, September 05, 2014 8:37 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Obtain GUID of driver supplied by microsoft

xxxxx@gmail.com wrote:

Tim Roberts wrote:
“Write a filter driver that accepts your custom requests, insert it as an
upper filter to your PCI\VEN_8086&DEV_3A18, and off you go. You will
not use an INF. You will not use a GUID. You will not be present in
Device Manager.”

Can you explain how to install my driver as “upper filter” without INF ?

Let me ask you the opposite question. How would you install it WITH an
INF? Remember the “toaster” sample installs a function driver PLUS a
filter. You want to add a filter to driver that already exists.

In the WDK samples, storage\filters\addfilter contains a generic example
of how to add an upper filter to a device that already exists. This
only tweaks the registry key; you still have to copy the file into place
and create a service for it. That can be done with a batch file.

In toaster.c, the user gets fdoData->BusInterface by calling:
status = WdfFdoQueryForInterface(Device,
&GUID_TOASTER_INTERFACE_STANDARD,
(PINTERFACE) &fdoData->BusInterface,
sizeof(TOASTER_INTERFACE_STANDARD),
1,
NULL);// InterfaceSpecific Data

In the toaster sample, the define GUID_TOASTER_INTERFACE_STANDARD is used
in the filter and also in the bus.
I guess in my case I will use a GUID not shared by other drivers.
Am I right ?

No. You will not use WdfFdoQueryForInterface at all. That whole
mechanism is used for communication between drivers.

You DO need to figure out how to let your user-mode clients find you.
For that, you might very well use a device interface, and that does need
a GUID.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Hi Tim,

I think I know why I got: No devices matched that name
According to addfiltr.htm this utility handles “only disk devices”

Thanks,
Zvika

-----Original Message-----
From: Tim Roberts
Sent: Friday, September 05, 2014 8:37 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Obtain GUID of driver supplied by microsoft

xxxxx@gmail.com wrote:

Tim Roberts wrote:
“Write a filter driver that accepts your custom requests, insert it as an
upper filter to your PCI\VEN_8086&DEV_3A18, and off you go. You will
not use an INF. You will not use a GUID. You will not be present in
Device Manager.”

Can you explain how to install my driver as “upper filter” without INF ?

Let me ask you the opposite question. How would you install it WITH an
INF? Remember the “toaster” sample installs a function driver PLUS a
filter. You want to add a filter to driver that already exists.

In the WDK samples, storage\filters\addfilter contains a generic example
of how to add an upper filter to a device that already exists. This
only tweaks the registry key; you still have to copy the file into place
and create a service for it. That can be done with a batch file.

In toaster.c, the user gets fdoData->BusInterface by calling:
status = WdfFdoQueryForInterface(Device,
&GUID_TOASTER_INTERFACE_STANDARD,
(PINTERFACE) &fdoData->BusInterface,
sizeof(TOASTER_INTERFACE_STANDARD),
1,
NULL);// InterfaceSpecific Data

In the toaster sample, the define GUID_TOASTER_INTERFACE_STANDARD is used
in the filter and also in the bus.
I guess in my case I will use a GUID not shared by other drivers.
Am I right ?

No. You will not use WdfFdoQueryForInterface at all. That whole
mechanism is used for communication between drivers.

You DO need to figure out how to let your user-mode clients find you.
For that, you might very well use a device interface, and that does need
a GUID.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Zvi Vered wrote:

I think I know why I got: No devices matched that name
According to addfiltr.htm this utility handles “only disk devices”

Yes. It’s a sample. You’ll have to modify it slightly. The only
reason it handles “only disk devices” is because those are the only
device class GUIDs they check for. You just have to substitute your own.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Dear Members,

I modified Addfilter and according to the device manager the “Intel(R) ICH10
LPC Interface Controller - 3A18”
has now an upper filter named: wdfsimple.sys

This file wdfsimple.sys was copied to c:\windows\system32\drivers.

After restart, there is (!) near “Intel(R) ICH10 LPC Interface Controller -
3A18”
The device status is:
Windows cannot start this hardware device because its configuration
information (in the registry) is incomplete or damaged. (Code 19)

According to the registry:

HKEY_LOCAL_MACHINE
SYSTEM
CurrentControlSet
Enum
PCI
3&13c0b0c5&0&F8

UpperFilters wdfsimple.sys

According to Tim’s reply I have to also install a service.
How can I install a service for this filter ?
Is this the cause to the problem ?

Thanks,
Zvika

-----Original Message-----
From: Tim Roberts
Sent: Saturday, September 06, 2014 12:54 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Obtain GUID of driver supplied by microsoft

Zvi Vered wrote:

I think I know why I got: No devices matched that name
According to addfiltr.htm this utility handles “only disk devices”

Yes. It’s a sample. You’ll have to modify it slightly. The only
reason it handles “only disk devices” is because those are the only
device class GUIDs they check for. You just have to substitute your own.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Dear Members,

My mistake.
When I called to:
AddFilterDriver(hDevInfo,
&DeviceInfoData,
_T(“wdfsimple”), // and not _T(“wdfsimple.sys”)
TRUE)

There was no error in the device manager.
Now I have to understand how to install the service.

Thanks,
Zvika

Hi Tony,

The GPIOs I will use are all coming out from the ICH to connector.

The following link contains the SPEC of this bridge:
http://www.intel.com/content/www/us/en/io/intel-io-controller-hub-8-datasheet.html
See page 423

Currently I do not have any information of GPIOs controlled by ACPI which I
can not use.

Is there a user level windows API to control GPIOs ?

Thanks,
Zvika

-----Original Message-----
From: xxxxx@rtd.com
Sent: Friday, September 05, 2014 3:57 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Obtain GUID of driver supplied by microsoft

I realize the slant of all the conversation is the literal how to get access
to the LPC bridge device register set, but I am back to the question of the
GPIO pins themselves.

Zvika, how are you getting access to the GPIO pins? Did the manufacturer of
the CPU board give you access to them by bringing them to a connector of
some kind?
Do you have a list of what GPIO are in use and for what purpose.

As was stated before, windows usually manages GPIO through ACPI code, so I
am curious how you know which GPIO are available for your use or HOW you
intend to connect to them?

Is this a design you have created?

Sincerely,
Tony


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

On Sep 6, 2014, at 10:41 AM, xxxxx@gmail.com wrote:

Dear Members,

My mistake.
When I called to:
AddFilterDriver(hDevInfo,
&DeviceInfoData,
_T(“wdfsimple”), // and not _T(“wdfsimple.sys”)
TRUE)

There was no error in the device manager.
Now I have to understand how to install the service.

Oh, please.
copy wdfsimple.sys c:\windows\system32\drivers
sc create wdfsimple type= kernel binPath= %SystemRoot%\System32\Drivers\wdfsimple.sys

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

On Sep 6, 2014, at 10:51 AM, Zvi Vered wrote:
>
> Currently I do not have any information of GPIOs controlled by ACPI which I
> can not use.

APCI is the right way to get access to GPIOs.

> Is there a user level windows API to control GPIOs ?

No. There aren?t even any KERNEL APIs to control GPIOs, because there has never been any standard for how GPIOs are connected. Every processor and every chipset is different.

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Just to expand on what Tim’s already written: Starting in Windows 8, there’s a standard for writing your own GPIO Controller Driver using the GPIO Class Extensions and then also writing your own GPIO Client Driver(s). Both of these assume appropriate and explicit support from the ACPI BIOS. These drivers would all almost certainly be written by the system supplier (given the BIOS integration involved) and not a third party adding a random whatsit to the system in the field.

Prior to Windows 8, GPIO lines were pretty much the exclusive province of the BIOS as far as Windows was concerned.

To echo what Tim said, prior to Win8, “[Writing code that’s part of the] ACPI [BIOS] is the right way to get access to the GPIOs”

Peter
OSR
@OSRDrivers

Dear Members,

Thanks to Tim,Peter,Doron,Anthony,Don,Jan,Maxim I built an upper filter for msisadrv.sys based on wdfsimple.sys

I managed to access GPIOs.
Did not try yet to set all GPIOs and I can not tell if some of them are already used by BIOS.

Your help is highly appreciable.

Best regards,
Zvika