Linking user level dll with kernel mode driver.

Hi,

How to link a user level library in the kernel mode driver?

I had placed all the Dlls and the lib files in the LIB includes path.
(DDK_LIB_PATH).

I also tried with TARGETLIBS.

But, Iam always getting Linker Error. LNK2001.(unresolved external symbol).

Thanks in Advance,

Regs,
A.Ilamparithi.
Senior Software Engineer,
QualSoft India.
Bangalore,
India.

Go immediately to your nearest white board and write 10,000,000 times

YOU CANNOT DO THIS, USER MODE CODE IS NOT FOR THE KERNEL.

Take a good driver writing class, until then stay out of the kernel.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

“A.Ilamparithi” wrote in message news:xxxxx@ntdev…
> Hi,
>
> How to link a user level library in the kernel mode driver?
>
> I had placed all the Dlls and the lib files in the LIB includes path.
> (DDK_LIB_PATH).
>
> I also tried with TARGETLIBS.
>
> But, Iam always getting Linker Error. LNK2001.(unresolved external
symbol).
>
> Thanks in Advance,
>
> Regs,
> A.Ilamparithi.
> Senior Software Engineer,
> QualSoft India.
> Bangalore,
> India.
>
>
>
>
>
>
>
>
>

Senior software engineer asking this. Hmm, Hmm

You cant. You dont want to do this. You have no reason to do this.

Dan

----- Original Message -----
From: “A.Ilamparithi”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Friday, July 23, 2004 8:16 AM
Subject: [ntdev] Linking user level dll with kernel mode driver.

> Hi,
>
> How to link a user level library in the kernel mode driver?
>
> I had placed all the Dlls and the lib files in the LIB includes path.
> (DDK_LIB_PATH).
>
> I also tried with TARGETLIBS.
>
> But, Iam always getting Linker Error. LNK2001.(unresolved external
symbol).
>
> Thanks in Advance,
>
> Regs,
> A.Ilamparithi.
> Senior Software Engineer,
> QualSoft India.
> Bangalore,
> India.
>
>
>
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Hi,

no need to put dlls just libs are enuff. but why do you need these wiered things?

 

luck,

yogi

From: “A.Ilamparithi”

>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Linking user level dll with kernel mode driver.
>Date: Thu, 22 Jul 2004 22:16:31 -0700
>
>Hi,
>
>How to link a user level library in the kernel mode driver?
>
>I had placed all the Dlls and the lib files in the LIB includes path.
>(DDK_LIB_PATH).
>
>I also tried with TARGETLIBS.
>
>But, Iam always getting Linker Error. LNK2001.(unresolved external symbol).
>
>Thanks in Advance,
>
>Regs,
>A.Ilamparithi.
>Senior Software Engineer,
>QualSoft India.
>Bangalore,
>India.
>
>
>
>
>
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Arrange your love marriage. On Shaadi.com.

Sheesh … you only link KERNEL with KERNEL. You CANNOT link KERNEL with USER. You do NOT link USER libs into KERNEL components and you do NOT link KERNEL libs into USER components.

During what part of Device Driver 101 did you two go to the toilette?


Gary G. Little
Seagate Technologies, LLC
“yatindra vaishnav” wrote in message news:xxxxx@ntdev…
Hi,

no need to put dlls just libs are enuff. but why do you need these wiered things?

luck,

yogi

>From: “A.Ilamparithi”
>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Linking user level dll with kernel mode driver.
>Date: Thu, 22 Jul 2004 22:16:31 -0700
>
>Hi,
>
>How to link a user level library in the kernel mode driver?
>
>I had placed all the Dlls and the lib files in the LIB includes path.
>(DDK_LIB_PATH).
>
>I also tried with TARGETLIBS.
>
>But, Iam always getting Linker Error. LNK2001.(unresolved external symbol).
>
>Thanks in Advance,
>
>Regs,
>A.Ilamparithi.
>Senior Software Engineer,
>QualSoft India.
>Bangalore,
>India.
>
>
>
>
>
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

------------------------------------------------------------------------------
Arrange your love marriage. On Shaadi.com.

just out of sheer, morbid curiosity, what would happen if a win32 usermode program, tried
to use an export from NTOSKRNL.exe. would it even link or would link whine about something???

asa

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Gary G. Little
Sent: Wednesday, July 28, 2004 1:49 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Linking user level dll with kernel mode driver.

Sheesh … you only link KERNEL with KERNEL. You CANNOT link KERNEL with USER. You do NOT link USER libs into KERNEL components and you do NOT link KERNEL libs into USER components.

During what part of Device Driver 101 did you two go to the toilette?


Gary G. Little
Seagate Technologies, LLC

“yatindra vaishnav” < xxxxx@hotmail.com> wrote in message news:xxxxx@ntdev…

Hi,

no need to put dlls just libs are enuff. but why do you need these wiered things?

luck,

yogi

From: “A.Ilamparithi”
>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Linking user level dll with kernel mode driver.
>Date: Thu, 22 Jul 2004 22:16:31 -0700
>
>Hi,
>
>How to link a user level library in the kernel mode driver?
>
>I had placed all the Dlls and the lib files in the LIB includes path.
>(DDK_LIB_PATH).
>
>I also tried with TARGETLIBS.
>
>But, Iam always getting Linker Error. LNK2001.(unresolved external symbol).
>
>Thanks in Advance,
>
>Regs,
>A.Ilamparithi.
>Senior Software Engineer,
>QualSoft India.
>Bangalore,
>India.
>
>
>
>
>
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_____

Arrange your love marriage. On Shaadi.com. http:


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@rivin.net
To unsubscribe send a blank email to xxxxx@lists.osr.com</http:>

You can make it link, but it won’t load or execute.

d


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
Sent: Wednesday, July 28, 2004 1:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Linking user level dll with kernel mode driver.

just out of sheer, morbid curiosity, what would happen if a win32 usermode program, tried
to use an?export from NTOSKRNL.exe. would it even link or would link whine about something???
?
asa
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Gary G. Little
Sent: Wednesday, July 28, 2004 1:49 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Linking user level dll with kernel mode driver.
Sheesh … you only link KERNEL with KERNEL. You CANNOT link KERNEL with USER. You do NOT link USER libs?into KERNEL components and you do NOT link KERNEL libs into USER components.?
?
During what part of Device Driver 101 did you two go to the toilette?


Gary G. Little
Seagate Technologies, LLC
“yatindra vaishnav” wrote in message news:xxxxx@ntdev…
Hi,
no need to put dlls just libs are enuff. but why do you need these wiered things?
?
luck,
yogi
>From: “A.Ilamparithi”
>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Linking user level dll with kernel mode driver.
>Date: Thu, 22 Jul 2004 22:16:31 -0700
>
>Hi,
>
>How to link a user level library in the kernel mode driver?
>
>I had placed all the Dlls and the lib files in the LIB includes path.
>(DDK_LIB_PATH).
>
>I also tried with TARGETLIBS.
>
>But, Iam always getting Linker Error. LNK2001.(unresolved external symbol).
>
>Thanks in Advance,
>
>Regs,
>A.Ilamparithi.
>Senior Software Engineer,
>QualSoft India.
>Bangalore,
>India.
>
>
>
>
>
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

________________________________________
Arrange your love marriage. On Shaadi.com.

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@rivin.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

probably either a DLL load failure or an access violation while loading
it.

-p


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
Sent: Wednesday, July 28, 2004 1:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Linking user level dll with kernel mode driver.

just out of sheer, morbid curiosity, what would happen if a win32
usermode program, tried
to use an export from NTOSKRNL.exe. would it even link or would link
whine about something???

asa

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Gary G. Little
Sent: Wednesday, July 28, 2004 1:49 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Linking user level dll with kernel mode
driver.

Sheesh … you only link KERNEL with KERNEL. You CANNOT link
KERNEL with USER. You do NOT link USER libs into KERNEL components and
you do NOT link KERNEL libs into USER components.

During what part of Device Driver 101 did you two go to the
toilette?


Gary G. Little
Seagate Technologies, LLC

“yatindra vaishnav” wrote in
message news:xxxxx@ntdev…

Hi,

no need to put dlls just libs are enuff. but why do you
need these wiered things?

luck,

yogi

>From: “A.Ilamparithi”
>Reply-To: “Windows System Software Devs Interest List”

>To: “Windows System Software Devs Interest List”

>Subject: [ntdev] Linking user level dll with kernel
mode driver.
>Date: Thu, 22 Jul 2004 22:16:31 -0700
>
>Hi,
>
>How to link a user level library in the kernel mode
driver?
>
>I had placed all the Dlls and the lib files in the LIB
includes path.
>(DDK_LIB_PATH).
>
>I also tried with TARGETLIBS.
>
>But, Iam always getting Linker Error.
LNK2001.(unresolved external symbol).
>
>Thanks in Advance,
>
>Regs,
>A.Ilamparithi.
>Senior Software Engineer,
>QualSoft India.
>Bangalore,
>India.
>
>
>
>
>
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as:
xxxxx@hotmail.com
>To unsubscribe send a blank email to
xxxxx@lists.osr.com

________________________________

Arrange your love marriage. On Shaadi.com.
http:


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@rivin.net
To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</http:>

It could be possible to force linker to use kernel exports but resulting binary will be probably refused by loader because of unresolvable imports. Try it.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http:://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Asa Yeamans[SMTP:xxxxx@rivin.net]
Reply To: Windows System Software Devs Interest List
Sent: Wednesday, July 28, 2004 10:12 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Linking user level dll with kernel mode driver.

just out of sheer, morbid curiosity, what would happen if a win32 usermode program, tried
to use an export from NTOSKRNL.exe. would it even link or would link whine about something???

asa

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Gary G. Little
Sent: Wednesday, July 28, 2004 1:49 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Linking user level dll with kernel mode driver.

Sheesh … you only link KERNEL with KERNEL. You CANNOT link KERNEL with USER. You do NOT link USER libs into KERNEL components and you do NOT link KERNEL libs into USER components.

During what part of Device Driver 101 did you two go to the toilette?


Gary G. Little
Seagate Technologies, LLC

“yatindra vaishnav” > wrote in message news:xxxxx
>
> Hi,
>
> no need to put dlls just libs are enuff. but why do you need these wiered things?
>
>
>
> luck,
>
> yogi
>
>
>
> >From: “A.Ilamparithi”
> >Reply-To: “Windows System Software Devs Interest List”
> >To: “Windows System Software Devs Interest List”
> >Subject: [ntdev] Linking user level dll with kernel mode driver.
> >Date: Thu, 22 Jul 2004 22:16:31 -0700
> >
> >Hi,
> >
> >How to link a user level library in the kernel mode driver?
> >
> >I had placed all the Dlls and the lib files in the LIB includes path.
> >(DDK_LIB_PATH).
> >
> >I also tried with TARGETLIBS.
> >
> >But, Iam always getting Linker Error. LNK2001.(unresolved external symbol).
> >
> >Thanks in Advance,
> >
> >Regs,
> >A.Ilamparithi.
> >Senior Software Engineer,
> >QualSoft India.
> >Bangalore,
> >India.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> _____
>
> Arrange your love marriage. On Shaadi.com. http:
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@rivin.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@upek.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
></http:></news:xxxxx>

Hey,

Ppl here to understand the problem and make things clear to the ppl who dont. Not to put such a shit like comment on them ok?

 

yogi

From: “Gary G. Little”

>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: Re:[ntdev] Linking user level dll with kernel mode driver.
>Date: Wed, 28 Jul 2004 13:48:30 -0500
>
>Sheesh … you only link KERNEL with KERNEL. You CANNOT link KERNEL with USER. You do NOT link USER libs into KERNEL components and you do NOT link KERNEL libs into USER components.
>
>During what part of Device Driver 101 did you two go to the toilette?
>
>–
>Gary G. Little
>Seagate Technologies, LLC
> “yatindra vaishnav” wrote in message news:xxxxx@ntdev…
> Hi,
>
> no need to put dlls just libs are enuff. but why do you need these wiered things?
>
>
>
> luck,
>
> yogi
>
>
>
> >From: “A.Ilamparithi”
> >Reply-To: “Windows System Software Devs Interest List”
> >To: “Windows System Software Devs Interest List”
> >Subject: [ntdev] Linking user level dll with kernel mode driver.
> >Date: Thu, 22 Jul 2004 22:16:31 -0700
> >
> >Hi,
> >
> >How to link a user level library in the kernel mode driver?
> >
> >I had placed all the Dlls and the lib files in the LIB includes path.
> >(DDK_LIB_PATH).
> >
> >I also tried with TARGETLIBS.
> >
> >But, Iam always getting Linker Error. LNK2001.(unresolved external symbol).
> >
> >Thanks in Advance,
> >
> >Regs,
> >A.Ilamparithi.
> >Senior Software Engineer,
> >QualSoft India.
> >Bangalore,
> >India.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >—
> >Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
> >
> >You are currently subscribed to ntdev as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>------------------------------------------------------------------------------
> Arrange your love marriage. On Shaadi.com.
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Studies, career, romance. Whatever your concerns. We have the answers.

This shouldn’t have required any thought at all. Recall how this works.
At link time, link.exe believes what you tell it. If you give it a
implib, you are asserting the future existence of a PE file with a
particular name reachable by PATH or via delay loading. Dumpbin /imports
will tell you what assumption it is making.

If, at runtime, it can’t find a PE file with that name, it won’t work.

There’s nothing magic about the kernel skeleton implib.

the handle is invalid message you are getting because DrvEnablePdev
couldn’t be called or didn’t fill the structures (devinfo,gdiinfo)
structures properly,etc.

thanks
vipin

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Robins, Scott
Sent: Thursday, July 29, 2004 5:41 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Linking user level dll with kernel mode driver.

I managed to link kernel entry points into a usermode printer driver.
When installing (or attempting to print) I got a message box (don’t know
from whom) that said “The handle is invalid”. That’s as useful a
message as can be expected I think.

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
Sent: Wednesday, July 28, 2004 4:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Linking user level dll with kernel mode driver.

just out of sheer, morbid curiosity, what would happen if a win32
usermode program, tried
to use an export from NTOSKRNL.exe. would it even link or would link
whine about something???

asa

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Gary G. Little
Sent: Wednesday, July 28, 2004 1:49 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Linking user level dll with kernel mode driver.

Sheesh … you only link KERNEL with KERNEL. You CANNOT link KERNEL with
USER. You do NOT link USER libs into KERNEL components and you do NOT
link KERNEL libs into USER components.

During what part of Device Driver 101 did you two go to the toilette?


Gary G. Little
Seagate Technologies, LLC

“yatindra vaishnav” wrote in message
news:xxxxx@ntdev…

Hi,

no need to put dlls just libs are enuff. but why do you need these
wiered things?

luck,

yogi

>From: “A.Ilamparithi”
>Reply-To: “Windows System Software Devs Interest List”

>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] Linking user level dll with kernel mode driver.
>Date: Thu, 22 Jul 2004 22:16:31 -0700
>
>Hi,
>
>How to link a user level library in the kernel mode driver?
>
>I had placed all the Dlls and the lib files in the LIB includes path.
>(DDK_LIB_PATH).
>
>I also tried with TARGETLIBS.
>
>But, Iam always getting Linker Error. LNK2001.(unresolved external
symbol).
>
>Thanks in Advance,
>
>Regs,
>A.Ilamparithi.
>Senior Software Engineer,
>QualSoft India.
>Bangalore,
>India.
>
>
>
>
>
>
>
>
>
>—
>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_____

Arrange your love marriage. On Shaadi.com.
http:


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@rivin.net
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@usa.xerox.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</http:>