Fw: Help: Sample KMDF Driver and Client to acces it

Hello All

I am very new to windows driver development. I have started this few weeks back. I am looking to do the following :- On Windows 7 / Windows Server 2008 , I would like to write?a small utility that would give me a “Physical address” of a Given application. E.g If I have “Notepad” application running on a desktop, I would like to get the “Physical Address” of the application.

This is the design I am thinking :-

  • Write KMDF driver that would receive the Virtual address of an application (in this case “Notepad”) and retrive the Physical address usng the API (MmGetPhysicalAddress) and return it back.
  • Write a Client that can access the KMDF driver and pass the Virtual address of the application (in this case “Notepad”) and return the Physical address.

Can you please guide me on how do I go about
?- Developing KMDF driver ? - Is there any sample code that I can reuse (I want to write a driver with minimalisitc code and options at this stage

  • How do I access the KMDF driver from Client application ? - I heard I need to use Creafile to open a connection but dont know how to go about
    -If some one can help me - set me up with what tools i should use, sample code of any sort to start the development, it would REALLY Help. I am in need of desperate help !!

Charlie

What you would be getting is the physical address of ONE PAGE of the
application. Why do you want the physical address, there is nothing
you can do with it? So what problem are you trying to solve?

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Charlie” wrote in message news:xxxxx@ntdev:

> Hello All
>
>
> I am very new to windows driver development. I have started this few weeks back. I am looking to do the following :- On Windows 7 / Windows Server 2008 , I would like to write a small utility that would give me a “Physical address” of a Given application. E.g If I have “Notepad” application running on a desktop, I would like to get the “Physical Address” of the application.
>
> This is the design I am thinking :-
> - Write KMDF driver that would receive the Virtual address of an application (in this case “Notepad”) and retrive the Physical address usng the API (MmGetPhysicalAddress) and return it back.
> - Write a Client that can access the KMDF driver and pass the Virtual address of the application (in this case “Notepad”) and return the Physical address.
>
> Can you please guide me on how do I go about
> - Developing KMDF driver ? - Is there any sample code that I can reuse (I want to write a driver with minimalisitc code and options at this stage
> - How do I access the KMDF driver from Client application ? - I heard I need to use Creafile to open a connection but dont know how to go about
> -If some one can help me - set me up with what tools i should use, sample code of any sort to start the development, it would REALLY Help. I am in need of desperate help !!
>
> Charlie

Hi Don
?
Idea is to “track” or “restrict” the movement of given application at the end but thats?bigger goal.?
?
What I am trying right now is a very small piece of that effort and needed in any case.
?
At this stage :- I am KEEN on writing a Kernel mode driver that does some thing specific to Kerner access (Get the Physical address Given a Virtual Address).? Access the KMDF driver from user mode (client) via a program/API, pass the valid Virtual address and receive the Physical address.
?
If I can get succint help around this task - It would make my last 20 days efforts worth.?
?
This is my FIRST task and I am finding this completely overwhelming.
?
How do I go about doing this ?
?
-Charlie

?


From: Don Burn
To: Windows System Software Devs Interest List
Sent: Saturday, January 19, 2013 2:29 PM
Subject: Re:[ntdev] Fw: Help: Sample KMDF Driver and Client to acces it

What you would be getting is the physical address of ONE PAGE of the
application.? Why do you want the physical address, there is nothing
you can do with it?? So what problem are you trying to solve?

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Charlie” wrote in message news:xxxxx@ntdev:

> Hello All
>
>
> I am very new to windows driver development. I have started this few weeks back. I am looking to do the following :- On Windows 7 / Windows Server 2008 , I would like to write?a small utility that would give me a “Physical address” of a Given application. E.g If I have “Notepad” application running on a desktop, I would like to get the “Physical Address” of the application.
>
> This is the design I am thinking :-
> - Write KMDF driver that would receive the Virtual address of an application (in this case “Notepad”) and retrive the Physical address usng the API (MmGetPhysicalAddress) and return it back.
> - Write a Client that can access the KMDF driver and pass the Virtual address of the application (in this case “Notepad”) and return the Physical address.
>
> Can you please guide me on how do I go about
> ?- Developing KMDF driver ? - Is there any sample code that I can reuse (I want to write a driver with minimalisitc code and options at this stage
> - How do I access the KMDF driver from Client application ? - I heard I need to use Creafile to open a connection but dont know how to go about
> -If some one can help me - set me up with what tools i should use, sample code of any sort to start the development, it would REALLY Help. I am in need of desperate help !!
>
> Charlie


NTDEV is sponsored by OSR

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

To start with KMDF take the toaster sample and use the func\simple
version to have a simple functional driver. Or you could use the sample
from OSR http://www.osronline.com/article.cfm?article=390 Most driver
developers start with something that exists. Then rips out what they
don’t want and add in the pieces they need.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Charlie” wrote in message news:xxxxx@ntdev:

> Hi Don
>
> Idea is to “track” or “restrict” the movement of given application at the end but thats bigger goal.
>
> What I am trying right now is a very small piece of that effort and needed in any case.
>
> At this stage :- I am KEEN on writing a Kernel mode driver that does some thing specific to Kerner access (Get the Physical address Given a Virtual Address). Access the KMDF driver from user mode (client) via a program/API, pass the valid Virtual address and receive the Physical address.
>
> If I can get succint help around this task - It would make my last 20 days efforts worth.
>
> This is my FIRST task and I am finding this completely overwhelming.
>
> How do I go about doing this ?
>
> -Charlie
>
>
>
> ________________________________
> From: Don Burn
> To: Windows System Software Devs Interest List
> Sent: Saturday, January 19, 2013 2:29 PM
> Subject: Re:[ntdev] Fw: Help: Sample KMDF Driver and Client to acces it
>
> What you would be getting is the physical address of ONE PAGE of the
> application. Why do you want the physical address, there is nothing
> you can do with it? So what problem are you trying to solve?
>
>
> Don Burn
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
> “Charlie” wrote in message news:xxxxx@ntdev:
>
> > Hello All
> >
> >
> > I am very new to windows driver development. I have started this few weeks back. I am looking to do the following :- On Windows 7 / Windows Server 2008 , I would like to write a small utility that would give me a “Physical address” of a Given application. E.g If I have “Notepad” application running on a desktop, I would like to get the “Physical Address” of the application.
> >
> > This is the design I am thinking :-
> > - Write KMDF driver that would receive the Virtual address of an application (in this case “Notepad”) and retrive the Physical address usng the API (MmGetPhysicalAddress) and return it back.
> > - Write a Client that can access the KMDF driver and pass the Virtual address of the application (in this case “Notepad”) and return the Physical address.
> >
> > Can you please guide me on how do I go about
> > - Developing KMDF driver ? - Is there any sample code that I can reuse (I want to write a driver with minimalisitc code and options at this stage
> > - How do I access the KMDF driver from Client application ? - I heard I need to use Creafile to open a connection but dont know how to go about
> > -If some one can help me - set me up with what tools i should use, sample code of any sort to start the development, it would REALLY Help. I am in need of desperate help !!
> >
> > Charlie
>
>
> —
> NTDEV is sponsored by OSR
>
> 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

What bigger problem are you trying to solve? to “track” or “restrict” is very unclear, you need to be more specific

d


From: Charliemailto:xxxxx
Sent: ?1/?19/?2013 2:39 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: Re: [ntdev] Fw: Help: Sample KMDF Driver and Client to acces it

Hi Don

Idea is to “track” or “restrict” the movement of given application at the end but thats bigger goal.

What I am trying right now is a very small piece of that effort and needed in any case.

At this stage :- I am KEEN on writing a Kernel mode driver that does some thing specific to Kerner access (Get the Physical address Given a Virtual Address). Access the KMDF driver from user mode (client) via a program/API, pass the valid Virtual address and receive the Physical address.

If I can get succint help around this task - It would make my last 20 days efforts worth.

This is my FIRST task and I am finding this completely overwhelming.

How do I go about doing this ?

-Charlie

From: Don Burn
To: Windows System Software Devs Interest List
Sent: Saturday, January 19, 2013 2:29 PM
Subject: Re:[ntdev] Fw: Help: Sample KMDF Driver and Client to acces it

What you would be getting is the physical address of ONE PAGE of the
application. Why do you want the physical address, there is nothing
you can do with it? So what problem are you trying to solve?

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Charlie” wrote in message news:xxxxx@ntdev:

> Hello All
>
>
> I am very new to windows driver development. I have started this few weeks back. I am looking to do the following :- On Windows 7 / Windows Server 2008 , I would like to write a small utility that would give me a “Physical address” of a Given application. E.g If I have “Notepad” application running on a desktop, I would like to get the “Physical Address” of the application.
>
> This is the design I am thinking :-
> - Write KMDF driver that would receive the Virtual address of an application (in this case “Notepad”) and retrive the Physical address usng the API (MmGetPhysicalAddress) and return it back.
> - Write a Client that can access the KMDF driver and pass the Virtual address of the application (in this case “Notepad”) and return the Physical address.
>
> Can you please guide me on how do I go about
> - Developing KMDF driver ? - Is there any sample code that I can reuse (I want to write a driver with minimalisitc code and options at this stage
> - How do I access the KMDF driver from Client application ? - I heard I need to use Creafile to open a connection but dont know how to go about
> -If some one can help me - set me up with what tools i should use, sample code of any sort to start the development, it would REALLY Help. I am in need of desperate help !!
>
> Charlie


NTDEV is sponsored by OSR

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


NTDEV is sponsored by OSR

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</mailto:xxxxx></mailto:xxxxx>

There is no such thing as “application’s physical address”. A (currently present) page may have a current physical address, but it’s ethemeral and may change at any time, unless the page is locked in memory. All pages of a given application have different and most likely non-contiguous physical addresses.

DOn - Thanks?a Ton. I looked at this example and must say, it did help.?Wish I had seen this earlier.? At present, I have a sample KMDF driver written. I am able to add that via “Add new Hardware” wizard, inclding getting the message in the DebugView when the driver Entry and Device Add functions are called.
?
Question now is - How do I access this driver from a Client ? Is there a similar sample around accessing the KMDF driver from Client (user mode) ?
?
Just for your info:- The INF file for my sample driver looks like this ( I modfied it to the extent where I can create Catalog file that I can then Sign).
?
; myshelldriver.INF

>; Windows installation file for installing the myshelldriver driver
>; Copyright (c) Microsoft Corporation All rights Reserved
>;
>; Installation Notes:
>;
>;??? Using Devcon: Type “devcon install myshelldriver.inf myshelldriver” to install
>;
>[Version]
>Signature=“$WINDOWS NT$”
>Class=Sample
>ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171}
>Provider=%MSFT%
>DriverVer=09/24/2012,1.0
>CatalogFile=myshell.cat
>[DestinationDirs]
>DefaultDestDir = 12
>[ClassInstall32]
>Addreg=SampleClassReg
>[SampleClassReg]
>HKR,0,%ClassName%
>HKR,Icon,-5
>[DiskCopyfiles]
>wdfmyshelldriver.sys
>[SourceDisksNames]
>1=%InstDisk%,
>[SourceDisksFiles]
>Wdfmyshelldriver.sys=1
>[Manufacturer]
>%MSFT% = DiskDevice,NTAMD64
>; For Win2K
>[DiskDevice]
>%DiskDevDesc% = DiskInstall, wdfmyshelldriver
>; For XP and later
>[DiskDevice.NTAMD64]
>%DiskDevDesc% = DiskInstall, wdfmyshelldriver
>[DiskInstall.NT]
>CopyFiles = DiskCopyfiles
>;;specify that this is the installation
>;;for nt based systems.
>[DriverInstall.ntx86]
>DriverVer=09/24/2012,1.0
>CopyFiles=DriverCopyFiles
>
>[DiskInstall.NT.Services]
>AddService = wdfmyshelldriver, %SPSVCINST_ASSOCSERVICE%, DiskServiceInst
>[DiskServiceInst]
>ServiceType?? = %SERVICE_KERNEL_DRIVER%
>StartType??? = %SERVICE_DEMAND_START%
>ErrorControl? = %SERVICE_ERROR_NORMAL%
>DisplayName?? = %DiskServiceDesc%
>ServiceBinary = %12%\Wdfmyshelldriver.sys
>AddReg??? = DiskAddReg
>[DiskAddReg]
>HKR, “Parameters”, “BreakOnEntry”,??? %REG_DWORD%, 0x00000000
>HKR, “Parameters”, “DiskSize”,??? %REG_DWORD%, 0x00100000
>HKR, “Parameters”, “DriveLetter”,??? %REG_SZ%,??? “R:”
>HKR, “Parameters”, “RootDirEntries”,??? %REG_DWORD%, 0x00000200
>HKR, “Parameters”, “SectorsPerCluster”, %REG_DWORD%, 0x00000002
>?
>
>[Strings]
>MSFT??? = “Microsoft”
>ClassName??? = “My Shell Device”
>DiskDevDesc??? = “WDF My Shell Driver”
>DiskServiceDesc = “myshelldriver Driver”
>InstDisk??? = “myshelldriver Install Disk”
>;*******************************************
>;Handy macro substitutions (non-localizable)
>SPSVCINST_ASSOCSERVICE = 0x00000002
>SERVICE_KERNEL_DRIVER? = 1
>SERVICE_DEMAND_START?? = 3
>SERVICE_ERROR_NORMAL?? = 1
>REG_DWORD??? = 0x00010001
>REG_SZ??? = 0x00000000?
?
?


From: Don Burn
To: Windows System Software Devs Interest List
Sent: Saturday, January 19, 2013 2:49 PM
Subject: Re:[ntdev] Fw: Help: Sample KMDF Driver and Client to acces it

To start with KMDF take the toaster sample and use the func\simple
version to have a simple functional driver.? Or you could use the sample
from OSR http://www.osronline.com/article.cfm?article=390? Most driver
developers start with something that exists.? Then rips out what they
don’t want and add in the pieces they need.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Charlie” wrote in message news:xxxxx@ntdev:

> Hi Don
> ?
> Idea is to “track” or “restrict” the movement of given application at the end but thats?bigger goal.?
> ?
> What I am trying right now is a very small piece of that effort and needed in any case.
> ?
> At this stage :- I am KEEN on writing a Kernel mode driver that does some thing specific to Kerner access (Get the Physical address Given a Virtual Address).? Access the KMDF driver from user mode (client) via a program/API, pass the valid Virtual address and receive the Physical address.
> ?
> If I can get succint help around this task - It would make my last 20 days efforts worth.?
> ?
> This is my FIRST task and I am finding this completely overwhelming.
> ?
> How do I go about doing this ?
> ?
> -Charlie
>
> ?
>
> ________________________________
> From: Don Burn
> To: Windows System Software Devs Interest List
> Sent: Saturday, January 19, 2013 2:29 PM
> Subject: Re:[ntdev] Fw: Help: Sample KMDF Driver and Client to acces it
>
> What you would be getting is the physical address of ONE PAGE of the
> application.? Why do you want the physical address, there is nothing
> you can do with it?? So what problem are you trying to solve?
>
>
> Don Burn
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
> “Charlie” wrote in message news:xxxxx@ntdev:
>
> > Hello All
> >
> >
> > I am very new to windows driver development. I have started this few weeks back. I am looking to do the following :- On Windows 7 / Windows Server 2008 , I would like to write?a small utility that would give me a “Physical address” of a Given application. E.g If I have “Notepad” application running on a desktop, I would like to get the “Physical Address” of the application.
> >
> > This is the design I am thinking :-
> > - Write KMDF driver that would receive the Virtual address of an application (in this case “Notepad”) and retrive the Physical address usng the API (MmGetPhysicalAddress) and return it back.
> > - Write a Client that can access the KMDF driver and pass the Virtual address of the application (in this case “Notepad”) and return the Physical address.
> >
> > Can you please guide me on how do I go about
> > ?- Developing KMDF driver ? - Is there any sample code that I can reuse (I want to write a driver with minimalisitc code and options at this stage
> > - How do I access the KMDF driver from Client application ? - I heard I need to use Creafile to open a connection but dont know how to go about
> > -If some one can help me - set me up with what tools i should use, sample code of any sort to start the development, it would REALLY Help. I am in need of desperate help !!
> >
> > Charlie
>
>
> —
> NTDEV is sponsored by OSR
>
> 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


NTDEV is sponsored by OSR

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

Look at the exe directory under the IOCTL sample, that is a fairly
simple sample of accessing a driver.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Charlie” wrote in message news:xxxxx@ntdev:

> DOn - Thanks a Ton. I looked at this example and must say, it did help. Wish I had seen this earlier. At present, I have a sample KMDF driver written. I am able to add that via “Add new Hardware” wizard, inclding getting the message in the DebugView when the driver Entry and Device Add functions are called.
>
> Question now is - How do I access this driver from a Client ? Is there a similar sample around accessing the KMDF driver from Client (user mode) ?
>
> Just for your info:- The INF file for my sample driver looks like this ( I modfied it to the extent where I can create Catalog file that I can then Sign).
>
> ; myshelldriver.INF
> >>; Windows installation file for installing the myshelldriver driver
> >>; Copyright (c) Microsoft Corporation All rights Reserved
> >>;
> >>; Installation Notes:
> >>;
> >>; Using Devcon: Type “devcon install myshelldriver.inf myshelldriver” to install
> >>;
> >>[Version]
> >>Signature=“$WINDOWS NT$”
> >>Class=Sample
> >>ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171}
> >>Provider=%MSFT%
> >>DriverVer=09/24/2012,1.0
> >>CatalogFile=myshell.cat
> >>[DestinationDirs]
> >>DefaultDestDir = 12
> >>[ClassInstall32]
> >>Addreg=SampleClassReg
> >>[SampleClassReg]
> >>HKR,0,%ClassName%
> >>HKR,Icon,-5
> >>[DiskCopyfiles]
> >>wdfmyshelldriver.sys
> >>[SourceDisksNames]
> >>1=%InstDisk%,
> >>[SourceDisksFiles]
> >>Wdfmyshelldriver.sys=1
> >>[Manufacturer]
> >>%MSFT% = DiskDevice,NTAMD64
> >>; For Win2K
> >>[DiskDevice]
> >>%DiskDevDesc% = DiskInstall, wdfmyshelldriver
> >>; For XP and later
> >>[DiskDevice.NTAMD64]
> >>%DiskDevDesc% = DiskInstall, wdfmyshelldriver
> >>[DiskInstall.NT]
> >>CopyFiles = DiskCopyfiles
> >>;;specify that this is the installation
> >>;;for nt based systems.
> >>[DriverInstall.ntx86]
> >>DriverVer=09/24/2012,1.0
> >>CopyFiles=DriverCopyFiles
> >>
> >>[DiskInstall.NT.Services]
> >>AddService = wdfmyshelldriver, %SPSVCINST_ASSOCSERVICE%, DiskServiceInst
> >>[DiskServiceInst]
> >>ServiceType = %SERVICE_KERNEL_DRIVER%
> >>StartType = %SERVICE_DEMAND_START%
> >>ErrorControl = %SERVICE_ERROR_NORMAL%
> >>DisplayName = %DiskServiceDesc%
> >>ServiceBinary = %12%\Wdfmyshelldriver.sys
> >>AddReg = DiskAddReg
> >>[DiskAddReg]
> >>HKR, “Parameters”, “BreakOnEntry”, %REG_DWORD%, 0x00000000
> >>HKR, “Parameters”, “DiskSize”, %REG_DWORD%, 0x00100000
> >>HKR, “Parameters”, “DriveLetter”, %REG_SZ%, “R:”
> >>HKR, “Parameters”, “RootDirEntries”, %REG_DWORD%, 0x00000200
> >>HKR, “Parameters”, “SectorsPerCluster”, %REG_DWORD%, 0x00000002
> >>
> >>
> >>[Strings]
> >>MSFT = “Microsoft”
> >>ClassName = “My Shell Device”
> >>DiskDevDesc = “WDF My Shell Driver”
> >>DiskServiceDesc = “myshelldriver Driver”
> >>InstDisk = “myshelldriver Install Disk”
> >>; *******************************************
> >>;Handy macro substitutions (non-localizable)
> >>SPSVCINST_ASSOCSERVICE = 0x00000002
> >>SERVICE_KERNEL_DRIVER = 1
> >>SERVICE_DEMAND_START = 3
> >>SERVICE_ERROR_NORMAL = 1
> >>REG_DWORD = 0x00010001
> >>REG_SZ = 0x00000000
>
>
>
>
>
> From: Don Burn
> To: Windows System Software Devs Interest List
> Sent: Saturday, January 19, 2013 2:49 PM
> Subject: Re:[ntdev] Fw: Help: Sample KMDF Driver and Client to acces it
>
> To start with KMDF take the toaster sample and use the func\simple
> version to have a simple functional driver. Or you could use the sample
> from OSR http://www.osronline.com/article.cfm?article=390 Most driver
> developers start with something that exists. Then rips out what they
> don’t want and add in the pieces they need.
>
>
> Don Burn
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
>
> “Charlie” wrote in message news:xxxxx@ntdev:
>
> > Hi Don
> >
> > Idea is to “track” or “restrict” the movement of given application at the end but thats bigger goal.
> >
> > What I am trying right now is a very small piece of that effort and needed in any case.
> >
> > At this stage :- I am KEEN on writing a Kernel mode driver that does some thing specific to Kerner access (Get the Physical address Given a Virtual Address). Access the KMDF driver from user mode (client) via a program/API, pass the valid Virtual address and receive the Physical address.
> >
> > If I can get succint help around this task - It would make my last 20 days efforts worth.
> >
> > This is my FIRST task and I am finding this completely overwhelming.
> >
> > How do I go about doing this ?
> >
> > -Charlie
> >
> >
> >
> >

> > From: Don Burn
> > To: Windows System Software Devs Interest List
> > Sent: Saturday, January 19, 2013 2:29 PM
> > Subject: Re:[ntdev] Fw: Help: Sample KMDF Driver and Client to acces it
> >
> > What you would be getting is the physical address of ONE PAGE of the
> > application. Why do you want the physical address, there is nothing
> > you can do with it? So what problem are you trying to solve?
> >
> >
> > Don Burn
> > Windows Filesystem and Driver Consulting
> > Website: http://www.windrvr.com
> > Blog: http://msmvps.com/blogs/WinDrvr
> >
> >
> >
> > “Charlie” wrote in message news:xxxxx@ntdev:
> >
> > > Hello All
> > >
> > >
> > > I am very new to windows driver development. I have started this few weeks back. I am looking to do the following :- On Windows 7 / Windows Server 2008 , I would like to write a small utility that would give me a “Physical address” of a Given application. E.g If I have “Notepad” application running on a desktop, I would like to get the “Physical Address” of the application.
> > >
> > > This is the design I am thinking :-
> > > - Write KMDF driver that would receive the Virtual address of an application (in this case “Notepad”) and retrive the Physical address usng the API (MmGetPhysicalAddress) and return it back.
> > > - Write a Client that can access the KMDF driver and pass the Virtual address of the application (in this case “Notepad”) and return the Physical address.
> > >
> > > Can you please guide me on how do I go about
> > > - Developing KMDF driver ? - Is there any sample code that I can reuse (I want to write a driver with minimalisitc code and options at this stage
> > > - How do I access the KMDF driver from Client application ? - I heard I need to use Creafile to open a connection but dont know how to go about
> > > -If some one can help me - set me up with what tools i should use, sample code of any sort to start the development, it would REALLY Help. I am in need of desperate help !!
> > >
> > > Charlie
> >
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > 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
>
>
> —
> NTDEV is sponsored by OSR
>
> 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

Charlie wrote:

DOn - Thanks a Ton. I looked at this example and must say, it did
help. Wish I had seen this earlier. At present, I have a sample KMDF
driver written. I am able to add that via “Add new Hardware” wizard,
inclding getting the message in the DebugView when the driver Entry
and Device Add functions are called.

Question now is - How do I access this driver from a Client ? Is there
a similar sample around accessing the KMDF driver from Client (user
mode) ?

Like all drivers, you use CreateFile to open a handle to the device. To
do that, of course, you have to have a file name. You can either create
a symbolic link name when you create the device, or you can create a
device interface and use SetupDiEnumDeviceInterfaces to find your path.

The device interface mechanism is wordier, but it is much more flexible.


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

Thank You Tim. It helps to know the SymbolicName usage. I was slightly confused on ‘DeviceName’ that I need to send while using the API to get a Handle.


From: Tim Roberts
To: Windows System Software Devs Interest List
Sent: Monday, January 21, 2013 10:28 AM
Subject: Re: [ntdev] Fw: Help: Sample KMDF Driver and Client to acces it

Charlie wrote:
> DOn - Thanks a Ton. I looked at this example and must say, it did
> help. Wish I had seen this earlier.? At present, I have a sample KMDF
> driver written. I am able to add that via “Add new Hardware” wizard,
> inclding getting the message in the DebugView when the driver Entry
> and Device Add functions are called.
>?
> Question now is - How do I access this driver from a Client ? Is there
> a similar sample around accessing the KMDF driver from Client (user
> mode) ?

Like all drivers, you use CreateFile to open a handle to the device.? To
do that, of course, you have to have a file name.? You can either create
a symbolic link name when you create the device, or you can create a
device interface and use SetupDiEnumDeviceInterfaces to find your path.

The device interface mechanism is wordier, but it is much more flexible.


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


NTDEV is sponsored by OSR

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