Hi, I am trying to compile a WDM/NT program. I have the
Windows DDK, and have been attempting to compile this code:
#include <windows.h>
#include <ntddk.h> (modified slightly to avoid conflicts with
WINDOWS.H)
int main(void) {
ObReferenceObjectByHandle(blah,…) //the parameters are
there in the real program
return 0;
}
So really the only thing im actually compileing in,is the one
function and I have added wdm.lib and wdmsec.lib to the link
parameters, however I still get this error message:
tests.obj : error LNK2019: unresolved external symbol
imp ObReferenceObjectByHandle referenced in function _main
Any sugggestions for getting this to compile? I have also
seen this with the IoXxx functions and have not been
successful in compileing with those either.
J.J.</ntddk.h></windows.h>
ObReferenceObjectByHandle is a kernel function and can’t be invoked from
a user-mode application.
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@uiuc.edu
Sent: Friday, May 19, 2006 2:11 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Linking Issues
Hi, I am trying to compile a WDM/NT program. I have the Windows DDK, and
have been attempting to compile this code:
#include <windows.h>
#include <ntddk.h> (modified slightly to avoid conflicts with
WINDOWS.H)
int main(void) {
ObReferenceObjectByHandle(blah,…) //the parameters are there in
the real program
return 0;
}
So really the only thing im actually compileing in,is the one function
and I have added wdm.lib and wdmsec.lib to the link parameters, however
I still get this error message:
tests.obj : error LNK2019: unresolved external symbol
imp ObReferenceObjectByHandle referenced in function _main
Any sugggestions for getting this to compile? I have also
seen this with the IoXxx functions and have not been
successful in compileing with those either.
J.J.
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</ntddk.h></windows.h>
Well since ObReferenceObjectByHandle is a kernel only function, and anything
from Windows.h is user only, I would say you have a big problem. As far as
the unresolved external, this function is not defined for WDM, only for the
ntoskrnl.lib, but as I say this isn’t going to help you have bigger
problems.
–
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply
wrote in message news:xxxxx@ntdev…
> Hi, I am trying to compile a WDM/NT program. I have the
> Windows DDK, and have been attempting to compile this code:
>
> #include <windows.h>
> #include <ntddk.h> (modified slightly to avoid conflicts with
> WINDOWS.H)
>
> int main(void) {
>
> ObReferenceObjectByHandle(blah,…) //the parameters are
> there in the real program
>
> return 0;
> }
>
> So really the only thing im actually compileing in,is the one
> function and I have added wdm.lib and wdmsec.lib to the link
> parameters, however I still get this error message:
>
> tests.obj : error LNK2019: unresolved external symbol
> imp ObReferenceObjectByHandle referenced in function _main
>
>
>
> Any sugggestions for getting this to compile? I have also
> seen this with the IoXxx functions and have not been
> successful in compileing with those either.
>
> J.J.
></ntddk.h></windows.h>
Thanks, for the help guys. I am working with Recording\Playback of File
I/O, and was attempting to do it via a normal application, but clearly I
need to go down the path of a driver. Thanks for pointing this out to
me. This should be enough to get me up and running on more development
though, so I’ll just come back if I need more help.
Thanks again!
> Thanks, for the help guys. I am working with Recording\Playback of File
I/O, and was attempting to do it via a normal application, but clearly I
So you want to write a file i/o record - playback product. So someone has
you write yet another file system replication product. You ask these kind of
questions? You are at square “-1” in the board of snakes and ladders. So
perhaps 2-3 years from now you will have a product; in the meantime, take
advice, do your career a favour, just forget this, grab some other job.
wrote in message news:xxxxx@ntdev…
> Hi, I am trying to compile a WDM/NT program. I have the
> Windows DDK, and have been attempting to compile this code:
>
> #include <windows.h>
> #include <ntddk.h> (modified slightly to avoid conflicts with
> WINDOWS.H)
>
> int main(void) {
>
> ObReferenceObjectByHandle(blah,…) //the parameters are
> there in the real program
>
> return 0;
> }
>
> So really the only thing im actually compileing in,is the one
> function and I have added wdm.lib and wdmsec.lib to the link
> parameters, however I still get this error message:
>
> tests.obj : error LNK2019: unresolved external symbol
> imp ObReferenceObjectByHandle referenced in function _main
>
>
>
> Any sugggestions for getting this to compile? I have also
> seen this with the IoXxx functions and have not been
> successful in compileing with those either.
>
> J.J.
></ntddk.h></windows.h>
> int main(void) {
ObReferenceObjectByHandle(blah,…) //the parameters are
main() is for user programs, while ObReferenceObjectByHandle is for kernel
modules. Do you understand the difference?
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
Yes guys, I understand what I was doing wrong. Looks like I have some
more work to do, and the project dosen’t require the use of these
functions, I am still in the research phase, so thanks for the advice, I
will most likely avoid writing this project!
Joe
I apologise I had not noticed your mail address and made some wrong
assumptions (my bad). I expect this is for some research project? If so, and
you want so say some more, I’d be happy to offer constructive advice, in as
much as I am able.
Good luck
Lyndon
“Joe Sestrich” wrote in message news:xxxxx@ntdev…
> Yes guys, I understand what I was doing wrong. Looks like I have some more
> work to do, and the project dosen’t require the use of these functions, I
> am still in the research phase, so thanks for the advice, I will most
> likely avoid writing this project!
>