if (pDeviceContext->UsbDevice == NULL) {
status = WdfUsbTargetDeviceCreate(Device,
WDF_NO_OBJECT_ATTRIBUTES, <=== line 179
&pDeviceContext->UsbDevice);
if (!NT_SUCCESS(status)) {
KdPrint((“WdfUsbTargetDeviceCreate failed %!STATUS!\n”, status));
return status;
}
}
Post the actual code change you made
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Tuesday, August 10, 2010 11:12 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Added “PAGED_CODE()”, it cannot pass WPP example
1>errors in directory c:\winddk\7600.16385.1\src\usb\osrusbfx2\kmdf\sys\step5
1>c:\winddk\7600.16385.1\src\usb\osrusbfx2\kmdf\sys\step5\step5.c(179) : error C4013: ‘WPP_CALL_step5_c179’ undefined; assuming extern returning int
Basically i started with step5 example and it builds.
then made some changes, still builds.
Now in line 179 in step5.c, i added PAGED_CODE(), it won’t build anymore with the above error.
Any hints ? Thanks !
1. cd c:\winddk\7600.16385.1\src\usb\osrusbfx2\kmdf\sys\step5, 2. build -ceZ works 3. edit xxxxx@step5.c, after UNREFERENCED_PARAMETER(InputBufferLength); UNREFERENCED_PARAMETER(OutputBufferLength)
put another line PAGED_CODE(); 4. now i get
Configuring OACR for ‘WDKSamples:amd64chk’ - Compiling - step5.c
1>errors in directory c:\winddk\7600.16385.1\src\usb\osrusbfx2\kmdf\sys\step5 1>c:\winddk\7600.16385.1\src\usb\osrusbfx2\kmdf\sys\step5\step5.c(242) : error C 4013: ‘WPP_CALL_step5_c242’ undefined; assuming extern returning int Linking Executable - objchk_win7_amd64\amd64\osrusbfx2.sys 1>link : error LNK1181: cannot open input file ‘c:\winddk\7600.16385.1\src\usb\o srusbfx2\kmdf\sys\step5\objchk_win7_amd64\amd64\step5.obj’ BUILD: Finish time: Tue Aug 10 15:57:19 2010 BUILD: Done
cd c:\winddk\7600.16385.1\src\usb\osrusbfx2\kmdf\sys\step5,
build -ceZ works
edit xxxxx@step5.c, after
UNREFERENCED_PARAMETER(InputBufferLength);
UNREFERENCED_PARAMETER(OutputBufferLength)
put another line
PAGED_CODE();
4. now i get
Configuring OACR for ‘WDKSamples:amd64chk’ - > Compiling - step5.c > 1>errors in directory c:\winddk\7600.16385.1\src\usb\osrusbfx2\kmdf\sys\step5 > 1>c:\winddk\7600.16385.1\src\usb\osrusbfx2\kmdf\sys\step5\step5.c(242) : error C > 4013: ‘WPP_CALL_step5_c242’ undefined; assuming extern returning int > Linking Executable - objchk_win7_amd64\amd64\osrusbfx2.sys
Yes, I can duplicate this. Very interesting problem. The PAGED_CODE() macro has a KdPrint call embedded in it, and apparently that call is not being properly caught by the WPP pre-processor.
– Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Tuesday, August 10, 2010 2:52 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Added “PAGED_CODE()”, it cannot pass WPP example
Pavel A. wrote:
Looks like wpp failed to update the tmh file after the change.
@ OP: try clean rebuild (build -cz)
Nope, that doesn’t do it. It’s more fundamental. The macro expansion is not right. You can see that in the step5.i file.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Configuring OACR for ‘WDKSamples:amd64chk’ - > Compiling - step5.c > 1>errors in directory c:\winddk\7600.16385.1\src\usb\osrusbfx2\kmdf\sys\step5 > 1>c:\winddk\7600.16385.1\src\usb\osrusbfx2\kmdf\sys\step5\step5.c(242) : error C > 4013: ‘WPP_CALL_step5_c242’ undefined; assuming extern returning int
So, here’s a new general rule: you cannot invoke your WPP trace macro from inside another macro. WPP won’t catch it.
You can fix this problem by editing \winddk\7600.16385.1\inc\wdm.h and changing line 11,555 from this: KdPrint((“EX: Pageable code called at IRQL %d\n”, KeGetCurrentIrql())); <br>to this: DbgPrint(“EX: Pageable code called at IRQL %d\n”, KeGetCurrentIrql()); <br> I am now 100% convinced this is the correct way to solve this problem. That is THE ONLY CASE in all of inc\api or inc\ddk where a macro calls KdPrint. Here, we are already inside an #ifdef DBG block, so we know the expansion will happen. And because that’s the only case, there are no other calls that can trigger this same issue.
And yes, I’ve already filed a bug bash entry for this…
– Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
Blank line where? Between the function name and return type or before the entire declaration? In general, you are very vague when you are describing your changes. Just post the code (Before/after might help)
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Wednesday, August 11, 2010 12:28 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Added “PAGED_CODE()”, it cannot pass WPP example
Tim,
Not sure your fix can work. I do have another messy code, if i put 1 more blank line before DriverEntry, it won’t compile. I del it, builds.
what is the compilation error? You have something really weird going on here
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Wednesday, August 11, 2010 12:39 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Added “PAGED_CODE()”, it cannot pass WPP example
not sure i can submit my code,
basically look at the lines between #endif and NTSTATUS,
if 2 lines, it builds, if 1 or 3, won’t build.
I don’t know what you are doing to get these results, but its not normal. Take any sample (unmodified), add a blank line after the pragma paged blocked and it will still compile
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Wednesday, August 11, 2010 12:42 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Added “PAGED_CODE()”, it cannot pass WPP example
Blank lines never cause trouble, unless it’s in the middle of a
multiline preprocessor macro.
However, you have some real confusion going on here. Originally, you
were talking about osrusbfx2/kmdf/sys/step5. Here, you seem to be in
src/general, but it shows a file called “4.c”, which does not exist
anywhere. The osrusbfx2 sample does not include any alloc_text pragmas,
and none of the samples have any functions called Ksrtm64Xxxxx.
If you are creating your own driver, create it in a directory that is
not part of the DDK tree. If you really have a mystery you cannot
solve, send the source to me privately (timr at probo dot com) and I’ll
post an explanation.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Is it possible you are editing your source file with an editor that fumbles
the line ending? On windows, a line ending of a text file is CR+LF. On *nix
it’s LF, on Mac’s before OS X it used to be CR but since OS X is a *nix
flavor don’t know if LF is now the Mac standard. Many WIndows tools will
cope with *nix style line endings but some will not. Really, EVERY Windows
text file should have CR+LF as a line ending.
This is one way where a “blank” line can matter.
Jan
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-421069- xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Wednesday, August 11, 2010 12:42 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Added “PAGED_CODE()”, it cannot pass WPP example
i’m behind the schedule so going back to the old LogEvent method.
But i’ll find some time next week to submit the broken case.
Thanks !
Doron Holan xxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 5263
RE: RE:Added “PAGED_CODE()”, it cannot pass WPP example
I don’t know what you are doing to get these results, but its not normal. Take
any sample (unmodified), add a blank line after the pragma paged blocked and it
will still compile