link qt to kmdf

Hi:

I’m too new to WinDDK (2 months?), still learning English, and first post
here. All this will be clear in a couple of lines, so why not mention it?

Thanks for continuing:

I have a custom PCI board with read / write registers on BARs 1 to 3. I
would like to access (read/write) those registers from an application
compiled with Qt 4.6.x on Windows.

My final question is about which of the alternatives is best to insist on
(having a ‘working’ KMDF driver):

  1. Build a user space EXE on Qt (against MinGW), or
  2. Build a .LIB, or .DLL using WinDDK’s ‘build -cegZ’ command, that exports
    ‘readRegister’ and ‘writeRegister’ functions, and
    Build an user space EXE on Qt (against MinGW) linking to that .LIB to
    use exported functions

Or there may be a better way to have it done.

      • What I have done so far, not too necessary to read - - -

Purpose: read a single PCI register in memory space of BAR1
O.S.: WinXP, SP3, 32bit
Device Driver type: KMDF
User application: Qt 4.6.x

Starting point: C:\WinDDK\7600.16385.1\src\general\pcidrv


I have modified some files on KMDF part of ‘pcidrv’ example to adjust to my
device and read registers directly (for example, in [NICMapHWResources()]
after BARs are mapped)
Then I have modified TEST part of ‘pcidrv’ and some part of KMDF to read a
register with an offset set on TEST’s window (modifying GetSrcMac - receives
the offset from QueryBuffer, and returns data on register. I modified
‘GetSrcMac’ as I don’t need any Mac Address and the communication between
user space and kernel space is done)
Then I have modified TEST part of ‘pcidrv’ to convert it to a command line
application.

So I have a ‘working’ KMDF device driver for my custom PCI board and a
command line application with which I can read registers. Both of them built
with ‘build -cegZ’ from command line.


And now I was trying to adapt that command-line application on QT

>>> alternative 1 >>>>
I have finally modified the files to built an executable against MinGW, but
crashes on first loop when trying to:

if (! SetupDiGetDeviceInterfaceDetail (
hardwareDeviceInfo,
&deviceInterfaceData,
deviceInterfaceDetailData,
predictedLength,
&requiredLength,
NULL)) {

Maybe because of too many changes.
<<<<<<<<<<<<<<<<<<<<

>>> alternative 2 >>>>
So I tried a workaround just for testing:
I have modified the ‘sources’ in TEST part of ‘pcidrv’ to build a library:
TARGETNAME=libmyping
TARGETTYPE=DRIVER_LIBRARY

and changed the first line of function main to:

int __cdecl ext_main( long offset )

so I have a libmyping.lib file generated.
But I can’t make Qt link a default Qt GUI application with a call to
‘ext_main(long)’

I have the following error message:

g++ -enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o
debug\test_libpci.exe debug/main.o debug/test_libpci.o
debug/moc_test_libpci.o -L"c:\Qt\4.6.2\lib" -lmingw32 -lqtmaind
-LC:/WinDDK/7600.16385.1/src/myEclipseTests/pcidrv/test/objchk_wxp_x86/i386
-llibmyping -lQtGuid4 -lQtCored4
debug/test_libpci.o: In function test_libpci': C:\WinDDK\7600.16385.1\src\myEclipseTests\test_libpci/test_libpci.cpp:19: undefined reference to ext_main(long)’
C:\WinDDK\7600.16385.1\src\myEclipseTests\test_libpci/test_libpci.cpp:19:
undefined reference to `ext_main(long)’
collect2: ld returned 1 exit status

The linker finds libmyping.lib file, but can’t find the function inside. I’m
lacking in background about .LIB/.DLL linking
<<<<<<<<<<<<<<<<<<<<

Please, once you made this great effort on reading, could you help me decide
which way is best to continue?

Thanks in advance,
Aitortxo.
A big mess?

Not going to happen. You cannot do IO from an application. You need to
rethink your design and have all IO performed in a kernel driver. The
receive side may consist of ring buffers that hold data until a request for
read is received from the application, or you may need to use an inverted
callback. However it’s done, you need to unthink the thought that you will
be able to do read/write IO registers from your application.

Gary G. Little

H (952) 223-1349

C (952) 454-4629

xxxxx@comcast.net

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Aitor Garmendia
Sent: Tuesday, September 07, 2010 9:49 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] link qt to kmdf

Hi:

I’m too new to WinDDK (2 months?), still learning English, and first post
here. All this will be clear in a couple of lines, so why not mention it?

Thanks for continuing:

I have a custom PCI board with read / write registers on BARs 1 to 3. I
would like to access (read/write) those registers from an application
compiled with Qt 4.6.x on Windows.

My final question is about which of the alternatives is best to insist on
(having a ‘working’ KMDF driver):

  1. Build a user space EXE on Qt (against MinGW), or
  2. Build a .LIB, or .DLL using WinDDK’s ‘build -cegZ’ command, that exports
    ‘readRegister’ and ‘writeRegister’ functions, and
    Build an user space EXE on Qt (against MinGW) linking to that .LIB to
    use exported functions

Or there may be a better way to have it done.

      • What I have done so far, not too necessary to read - - -

Purpose: read a single PCI register in memory space of BAR1
O.S.: WinXP, SP3, 32bit
Device Driver type: KMDF
User application: Qt 4.6.x

Starting point: C:\WinDDK\7600.16385.1\src\general\pcidrv


I have modified some files on KMDF part of ‘pcidrv’ example to adjust to my
device and read registers directly (for example, in [NICMapHWResources()]
after BARs are mapped)
Then I have modified TEST part of ‘pcidrv’ and some part of KMDF to read a
register with an offset set on TEST’s window (modifying GetSrcMac - receives
the offset from QueryBuffer, and returns data on register. I modified
‘GetSrcMac’ as I don’t need any Mac Address and the communication between
user space and kernel space is done)
Then I have modified TEST part of ‘pcidrv’ to convert it to a command line
application.

So I have a ‘working’ KMDF device driver for my custom PCI board and a
command line application with which I can read registers. Both of them built
with ‘build -cegZ’ from command line.


And now I was trying to adapt that command-line application on QT

>>> alternative 1 >>>>
I have finally modified the files to built an executable against MinGW, but
crashes on first loop when trying to:

if (! SetupDiGetDeviceInterfaceDetail (
hardwareDeviceInfo,
&deviceInterfaceData,
deviceInterfaceDetailData,
predictedLength,
&requiredLength,
NULL)) {

Maybe because of too many changes.
<<<<<<<<<<<<<<<<<<<<

>>> alternative 2 >>>>
So I tried a workaround just for testing:
I have modified the ‘sources’ in TEST part of ‘pcidrv’ to build a library:
TARGETNAME=libmyping
TARGETTYPE=DRIVER_LIBRARY

and changed the first line of function main to:

int __cdecl ext_main( long offset )

so I have a libmyping.lib file generated.
But I can’t make Qt link a default Qt GUI application with a call to
‘ext_main(long)’

I have the following error message:

g++ -enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o
debug\test_libpci.exe debug/main.o debug/test_libpci.o
debug/moc_test_libpci.o -L"c:\Qt\4.6.2\lib" -lmingw32 -lqtmaind
-LC:/WinDDK/7600.16385.1/src/myEclipseTests/pcidrv/test/objchk_wxp_x86/i386
-llibmyping -lQtGuid4 -lQtCored4
debug/test_libpci.o: In function test_libpci': C:\WinDDK\7600.16385.1\src\myEclipseTests\test_libpci/test_libpci.cpp:19: undefined reference to ext_main(long)’
C:\WinDDK\7600.16385.1\src\myEclipseTests\test_libpci/test_libpci.cpp:19:
undefined reference to `ext_main(long)’
collect2: ld returned 1 exit status

The linker finds libmyping.lib file, but can’t find the function inside. I’m
lacking in background about .LIB/.DLL linking
<<<<<<<<<<<<<<<<<<<<

Please, once you made this great effort on reading, could you help me decide
which way is best to continue?

Thanks in advance,
Aitortxo.
A big mess?

— NTDEV is sponsored by OSR 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

Typically, you would build a DLL that gives you access to your kernel driver.  The DLL would take care of opening / closing the driver and would export functions you could call from a user-land .exe.  You could use either the WDK or some other convenient development environment, like Visual Studio, to build the DLL.  Your Qt app would then link against the DLL and call its functions. 

----- Original Message -----
From: “Aitor Garmendia”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, September 7, 2010 8:48:53 AM
Subject: [ntdev] link qt to kmdf

Hi:

I’m too new to WinDDK (2 months?), still learning English, and first post here. All this will be clear in a couple of lines, so why not mention it?

Thanks for continuing:

I have a custom PCI board with read / write registers on BARs 1 to 3. I would like to access (read/write) those registers from an application compiled with Qt 4.6.x on Windows.

My final question is about which of the alternatives is best to insist on (having a ‘working’ KMDF driver):
1) Build a user space EXE on Qt (against MinGW), or
2) Build a .LIB, or .DLL using WinDDK’s ‘build -cegZ’ command, that exports ‘readRegister’ and ‘writeRegister’ functions, and
Build an user space EXE on Qt (against MinGW) linking to that .LIB to use exported functions

Or there may be a better way to have it done.

- - - What I have done so far, not too necessary to read - - -

Purpose: read a single PCI register in memory space of BAR1
O.S.: WinXP, SP3, 32bit
Device Driver type: KMDF
User application: Qt 4.6.x

Starting point: C:\WinDDK\7600.16385.1\src\general\pcidrv

- - -

I have modified some files on KMDF part of ‘pcidrv’ example to adjust to my device and read registers directly (for example, in [NICMapHWResources()] after BARs are mapped)
Then I have modified TEST part of ‘pcidrv’ and some part of KMDF to read a register with an offset set on TEST’s window (modifying GetSrcMac - receives the offset from QueryBuffer, and returns data on register. I modified ‘GetSrcMac’ as I don’t need any Mac Address and the communication between user space and kernel space is done)
Then I have modified TEST part of ‘pcidrv’ to convert it to a command line application.

So I have a ‘working’ KMDF device driver for my custom PCI board and a command line application with which I can read registers. Both of them built with ‘build -cegZ’ from command line.

- - -

And now I was trying to adapt that command-line application on QT

>>>> alternative 1 >>>>
I have finally modified the files to built an executable against MinGW, but crashes on first loop when trying to:

if (! SetupDiGetDeviceInterfaceDetail (
hardwareDeviceInfo,
&deviceInterfaceData,
deviceInterfaceDetailData,
predictedLength,
&requiredLength,
NULL)) {

Maybe because of too many changes.
<<<<<<<<<<<<<<<<<<<<

>>>> alternative 2 >>>>
So I tried a workaround just for testing:
I have modified the ‘sources’ in TEST part of ‘pcidrv’ to build a library:
TARGETNAME=libmyping
TARGETTYPE=DRIVER_LIBRARY

and changed the first line of function main to:

int __cdecl ext_main( long offset )

so I have a libmyping.lib file generated.
But I can’t make Qt link a default Qt GUI application with a call to ‘ext_main(long)’

I have the following error message:

g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\test_libpci.exe debug/main.o debug/test_libpci.o debug/moc_test_libpci.o -L"c:\Qt\4.6.2\lib" -lmingw32 -lqtmaind -LC:/WinDDK/7600.16385.1/src/myEclipseTests/pcidrv/test/objchk_wxp_x86/i386 -llibmyping -lQtGuid4 -lQtCored4
debug/test_libpci.o: In function test_libpci': <br>C:\WinDDK\7600.16385.1\src\myEclipseTests\test_libpci/test_libpci.cpp:19: undefined reference to ext_main(long)’
C:\WinDDK\7600.16385.1\src\myEclipseTests\test_libpci/test_libpci.cpp:19: undefined reference to `ext_main(long)’
collect2: ld returned 1 exit status

The linker finds libmyping.lib file, but can’t find the function inside. I’m lacking in background about .LIB/.DLL linking
<<<<<<<<<<<<<<<<<<<<

Please, once you made this great effort on reading, could you help me decide which way is best to continue?

Thanks in advance,
Aitortxo.
A big mess?

— NTDEV is sponsored by OSR 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

>those registers from an application compiled with Qt 4.6.x on Windows.

You cannot (at least you cannot do this reliably, stably and product-quality). Build a KMDF driver instead, and call DeviceIoControl from your app - Qt or non-Qt, not important.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>to unthink

This is a new English word for me :slight_smile: is it from Orwell and related to “thoughtcrime”?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

It’s just a Littleism that I figured wouldn’t get me in trouble. :slight_smile:

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Wednesday, September 08, 2010 8:31 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] link qt to kmdf

to unthink

This is a new English word for me :slight_smile: is it from Orwell and related to
“thoughtcrime”?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com


NTDEV is sponsored by OSR

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

In addition to all the advice to not even bother trying (use
DeviceIoControl), one serious question is why you need to read or write the
BAR registers. In modern drivers, you should not need to touch these. What
is the rationale here?

Bottom line: you should not try to use user-level libraries (like Qt, MFC,
etc.) in the kernel, and you cannot use kernel capabilities in user space.
joe


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Aitor Garmendia
Sent: Tuesday, September 07, 2010 10:49 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] link qt to kmdf

Hi:

I’m too new to WinDDK (2 months?), still learning English, and first post
here. All this will be clear in a couple of lines, so why not mention it?

Thanks for continuing:

I have a custom PCI board with read / write registers on BARs 1 to 3. I
would like to access (read/write) those registers from an application
compiled with Qt 4.6.x on Windows.

My final question is about which of the alternatives is best to insist on
(having a ‘working’ KMDF driver):

  1. Build a user space EXE on Qt (against MinGW), or
  2. Build a .LIB, or .DLL using WinDDK’s ‘build -cegZ’ command, that exports
    ‘readRegister’ and ‘writeRegister’ functions, and
    Build an user space EXE on Qt (against MinGW) linking to that .LIB to
    use exported functions

Or there may be a better way to have it done.

      • What I have done so far, not too necessary to read - - -

Purpose: read a single PCI register in memory space of BAR1
O.S.: WinXP, SP3, 32bit
Device Driver type: KMDF
User application: Qt 4.6.x

Starting point: C:\WinDDK\7600.16385.1\src\general\pcidrv


I have modified some files on KMDF part of ‘pcidrv’ example to adjust to my
device and read registers directly (for example, in [NICMapHWResources()]
after BARs are mapped)
Then I have modified TEST part of ‘pcidrv’ and some part of KMDF to read a
register with an offset set on TEST’s window (modifying GetSrcMac - receives
the offset from QueryBuffer, and returns data on register. I modified
‘GetSrcMac’ as I don’t need any Mac Address and the communication between
user space and kernel space is done)
Then I have modified TEST part of ‘pcidrv’ to convert it to a command line
application.

So I have a ‘working’ KMDF device driver for my custom PCI board and a
command line application with which I can read registers. Both of them built
with ‘build -cegZ’ from command line.


And now I was trying to adapt that command-line application on QT

>>> alternative 1 >>>>
I have finally modified the files to built an executable against MinGW, but
crashes on first loop when trying to:

if (! SetupDiGetDeviceInterfaceDetail (
hardwareDeviceInfo,
&deviceInterfaceData,
deviceInterfaceDetailData,
predictedLength,
&requiredLength,
NULL)) {

Maybe because of too many changes.
<<<<<<<<<<<<<<<<<<<<

>>> alternative 2 >>>>
So I tried a workaround just for testing:
I have modified the ‘sources’ in TEST part of ‘pcidrv’ to build a library:
TARGETNAME=libmyping
TARGETTYPE=DRIVER_LIBRARY

and changed the first line of function main to:

int __cdecl ext_main( long offset )

so I have a libmyping.lib file generated.
But I can’t make Qt link a default Qt GUI application with a call to
‘ext_main(long)’

I have the following error message:

g++ -enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o
debug\test_libpci.exe debug/main.o debug/test_libpci.o
debug/moc_test_libpci.o -L"c:\Qt\4.6.2\lib" -lmingw32 -lqtmaind
-LC:/WinDDK/7600.16385.1/src/myEclipseTests/pcidrv/test/objchk_wxp_x86/i386
-llibmyping -lQtGuid4 -lQtCored4
debug/test_libpci.o: In function test_libpci': C:\WinDDK\7600.16385.1\src\myEclipseTests\test_libpci/test_libpci.cpp:19: undefined reference to ext_main(long)’
C:\WinDDK\7600.16385.1\src\myEclipseTests\test_libpci/test_libpci.cpp:19:
undefined reference to `ext_main(long)’
collect2: ld returned 1 exit status

The linker finds libmyping.lib file, but can’t find the function inside. I’m
lacking in background about .LIB/.DLL linking
<<<<<<<<<<<<<<<<<<<<

Please, once you made this great effort on reading, could you help me decide
which way is best to continue?

Thanks in advance,
Aitortxo.
A big mess?

— NTDEV is sponsored by OSR 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

This message has been scanned for viruses and
dangerous content by http:</http:> MailScanner, and is
believed to be clean.

Joseph M. Newcomer wrote:

In addition to all the advice to not even bother trying (use
DeviceIoControl), one serious question is why you need to read or
write the BAR registers. In modern drivers, you should not need to
touch these. What is the rationale here?

You misinterpreted him. He doesn’t want to write the BARs. He wants to
write to the registers within the space that the BARs point to.


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

OK, that’s also odd, because this should be made available at the
IRP_MJ_PNP:IRP_MN_START handler; otherwise, he has to not only read the
BARs, but use HalTranslateBusAddress, which is considered obsolete.
joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, September 08, 2010 12:43 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] link qt to kmdf

Joseph M. Newcomer wrote:

In addition to all the advice to not even bother trying (use
DeviceIoControl), one serious question is why you need to read or
write the BAR registers. In modern drivers, you should not need to
touch these. What is the rationale here?

You misinterpreted him. He doesn’t want to write the BARs. He wants to
write to the registers within the space that the BARs point to.


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


NTDEV is sponsored by OSR

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


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

My understanding was that the OP wanted to use Qt, pronounced cute, to do
some cute coding and allow IO to be performed at user level. To quote their
original post:

" I have a custom PCI board with read / write registers on BARs 1 to 3. I
would like to access (read/write) those registers from an application
compiled with Qt 4.6.x on Windows."

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Joseph M. Newcomer
Sent: Wednesday, September 08, 2010 12:07 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] link qt to kmdf

OK, that’s also odd, because this should be made available at the
IRP_MJ_PNP:IRP_MN_START handler; otherwise, he has to not only read the
BARs, but use HalTranslateBusAddress, which is considered obsolete.
joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, September 08, 2010 12:43 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] link qt to kmdf

Joseph M. Newcomer wrote:

In addition to all the advice to not even bother trying (use
DeviceIoControl), one serious question is why you need to read or
write the BAR registers. In modern drivers, you should not need to
touch these. What is the rationale here?

You misinterpreted him. He doesn’t want to write the BARs. He wants to
write to the registers within the space that the BARs point to.


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


NTDEV is sponsored by OSR

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


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


NTDEV is sponsored by OSR

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

I saw that, but because it basically doesn’t make any sense, and others had
answered that it required a DeviceIoControl, I didn’t see that Qt had
anything to do with the problem. Someone who thinks they can read hardware
registers from user space has spent too much time in MS-DOS. So the basic
question was nonsense. Now, it is reasonable to consider that writing, via
WRITE_PORT_xxxx calls, that writing the ports is reasonable. But as to why
anyone would want to write registers from user space, I have no idea. The
earlier suggestion of having a DeviceIoControl that sent down information to
be written works, but then, why does this matter in terms of the registers
and their relationship to the BARs? So I was left confused. Normally, you
think of the interface to a piece of hardware in terms of its abstraction,
not in terms of its implementation. Say those particular registers are some
kind of diagnostic registers. Then I would create a DeviceIoControl which
was “run diagnostics”, and at no point would I be overly concerned as to
which registers were involved or where they were defined on the card. The
call would run diagnostics.

It sounds like the OP was trying to work at the wrong level of design,
thinking in terms of low-level registers.

I’ve had to fix drivers like this. Worse still, I had to convey to the
client that the old driver would not work with their new card except if they
caused their computer to smoke illegal substances, which did not seem
likely. I quoted a price for a rewrite, which caused them to essentially
faint. Thinking I was saying all this so they’d hire me to rewrite the
driver, they hired someone else. Two years later, their “new” hardware is
still not available.

Application programmers thinking of interfaces in these terms are a little
bit scary. That’s why I try to “head them off” when they start down this
kind of path, with these kinds of questions. The OP is obviously new at
this, and that leads to design decisions which are not always optimal or
even, in some cases, sensible (if the OP were experienced, this question
would not have been asked because the answer would have been obvious). As
in most such cases, I try to find out “what are you trying to accomplish?”
instead of saying “Write code that does THIS” (which answers their question
but doesn’t actually solve the REAL problem). My S.O. says that I’ve been
living with her too long and I’ve learned to turn a first-level reference
question (“Where’s the water fountain?”) into a third-level reference
question (“Wouldn’t you like a nice book on the history of water fountains,
a comparative study of contemporary water fountains, or a study of human
thirst and its influence on ‘water wars’?”–that’s what librarians are
trained to do [and she hasn’t been a public reference librarian for decades;
she’s now a professor in the library school]).
joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
Sent: Wednesday, September 08, 2010 2:20 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] link qt to kmdf

My understanding was that the OP wanted to use Qt, pronounced cute, to do
some cute coding and allow IO to be performed at user level. To quote their
original post:

" I have a custom PCI board with read / write registers on BARs 1 to 3. I
would like to access (read/write) those registers from an application
compiled with Qt 4.6.x on Windows."

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Joseph M. Newcomer
Sent: Wednesday, September 08, 2010 12:07 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] link qt to kmdf

OK, that’s also odd, because this should be made available at the
IRP_MJ_PNP:IRP_MN_START handler; otherwise, he has to not only read the
BARs, but use HalTranslateBusAddress, which is considered obsolete.
joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, September 08, 2010 12:43 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] link qt to kmdf

Joseph M. Newcomer wrote:

In addition to all the advice to not even bother trying (use
DeviceIoControl), one serious question is why you need to read or
write the BAR registers. In modern drivers, you should not need to
touch these. What is the rationale here?

You misinterpreted him. He doesn’t want to write the BARs. He wants to
write to the registers within the space that the BARs point to.


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


NTDEV is sponsored by OSR

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


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


NTDEV is sponsored by OSR

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

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


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.