how to create my own library files to be linked to my driver?

Hi,

I created a lib file (not using MFC) using visual c.
And i tried to link this lib in my driver.
I have included the .h file for this lib in my driver
and the source file :
ARGETNAME=mydriver
TARGETPATH=obj
TARGETTYPE=DRIVER

TARGETLIBS=$(WXPBASE)\lib\wxp*\wdmsec.lib C:\Programming\mylib\mylib.lib

INCLUDES=C:\IFSKit\src\filesys\inc

SOURCES=mydriver.c \
mydriver.rc

and it always has an error :
mydriver.obj : error LNK2019: unresolved external symbol _set_up@16
referenced in function _dothis@0

set_up function call has be delcared in the .h file

hope you can help

thank you

cheers,
vincent


Get 10mb of inbox space with MSN Hotmail Extra Storage
http://join.msn.com/?pgmarket=en-sg

Check the calling convention. By default VC uses __cdecl and the drivers
expect __stdcall.
thanks
-Kiran

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of vincent gambit
Sent: Tuesday, December 09, 2003 2:29 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] how to create my own library files to be linked to my
driver?

Hi,

I created a lib file (not using MFC) using visual c.
And i tried to link this lib in my driver.
I have included the .h file for this lib in my driver
and the source file :
ARGETNAME=mydriver
TARGETPATH=obj
TARGETTYPE=DRIVER

TARGETLIBS=$(WXPBASE)\lib\wxp*\wdmsec.lib C:\Programming\mylib\mylib.lib

INCLUDES=C:\IFSKit\src\filesys\inc

SOURCES=mydriver.c \
mydriver.rc

and it always has an error :
mydriver.obj : error LNK2019: unresolved external symbol _set_up@16
referenced in function _dothis@0

set_up function call has be delcared in the .h file

hope you can help

thank you

cheers,
vincent


Get 10mb of inbox space with MSN Hotmail Extra Storage
http://join.msn.com/?pgmarket=en-sg


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I needed to solve this problem a few days ago. In Visual C,
all you need to do is simply include a DEF file in your driver
project and then build the driver. You will get a LIB file, which
is then simply compilable in another driver project (compiled in
Visual C too)

The only thing I don’t know is the “sources” file with the directives;
I don’t use it at all.

L.

hi,

Thanks for your reply
it worked for the driver now
however it didnt work for my VC now.
I am sharing this lib file for the VC and my driver.

How can have a single lib file which can be used for both VC and driver?

Thank You!

cheers,
vincent

From: “Kiran Joshi”
>Reply-To: “Windows File Systems Devs Interest List”
>To: “Windows File Systems Devs Interest List”
>Subject: [ntfsd] RE: how to create my own library files to be linked to my
>driver?
>Date: Tue, 9 Dec 2003 14:46:00 +0530
>
>Check the calling convention. By default VC uses cdecl and the drivers
>expect
stdcall.
>thanks
>-Kiran
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com]On Behalf Of vincent gambit
>Sent: Tuesday, December 09, 2003 2:29 PM
>To: Windows File Systems Devs Interest List
>Subject: [ntfsd] how to create my own library files to be linked to my
>driver?
>
>
>Hi,
>
>I created a lib file (not using MFC) using visual c.
>And i tried to link this lib in my driver.
>I have included the .h file for this lib in my driver
>and the source file :
>ARGETNAME=mydriver
>TARGETPATH=obj
>TARGETTYPE=DRIVER
>
>TARGETLIBS=$(WXPBASE)\lib\wxp*\wdmsec.lib C:\Programming\mylib\mylib.lib
>
>INCLUDES=C:\IFSKit\src\filesys\inc
>
>SOURCES=mydriver.c <br>> mydriver.rc
>
>and it always has an error :
>mydriver.obj : error LNK2019: unresolved external symbol _set_up@16
>referenced in function _dothis@0
>
>set_up function call has be delcared in the .h file
>
>hope you can help
>
>thank you
>
>cheers,
>vincent
>
>
>Get 10mb of inbox space with MSN Hotmail Extra Storage
>http://join.msn.com/?pgmarket=en-sg
>
>
>—
>Questions? First check the IFS FAQ at
>https://www.osronline.com/article.cfm?id=17
>
>You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>Questions? First check the IFS FAQ at
>https://www.osronline.com/article.cfm?id=17
>
>You are currently subscribed to ntfsd as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Download games, logos, wallpapers and lots more at MSN Mobile!
http://www.msn.com.sg/mobile/

Hello Vincent,

Now what is happening is that the user application is expecting cdecl and
you are using stdcall.
I think what you will have to do is declare these functions as stdcall in
the header file and use this same header file in both places user/kernel.
This will ensure that you use only single calling convention at both places
and the user application and driver should both compile properly using the
same lib file.

thanks
-Kiran
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of vincent gambit
Sent: Tuesday, December 09, 2003 3:29 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] RE: how to create my own library files to be linked to
my driver?

hi,

Thanks for your reply
it worked for the driver now
however it didnt work for my VC now.
I am sharing this lib file for the VC and my driver.

How can have a single lib file which can be used for both VC and driver?

Thank You!

cheers,
vincent

From: “Kiran Joshi”
>Reply-To: “Windows File Systems Devs Interest List”
>To: “Windows File Systems Devs Interest List”
>Subject: [ntfsd] RE: how to create my own library files to be linked to my
>driver?
>Date: Tue, 9 Dec 2003 14:46:00 +0530
>
>Check the calling convention. By default VC uses cdecl and the drivers
>expect
stdcall.
>thanks
>-Kiran
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com]On Behalf Of vincent gambit
>Sent: Tuesday, December 09, 2003 2:29 PM
>To: Windows File Systems Devs Interest List
>Subject: [ntfsd] how to create my own library files to be linked to my
>driver?
>
>
>Hi,
>
>I created a lib file (not using MFC) using visual c.
>And i tried to link this lib in my driver.
>I have included the .h file for this lib in my driver
>and the source file :
>ARGETNAME=mydriver
>TARGETPATH=obj
>TARGETTYPE=DRIVER
>
>TARGETLIBS=$(WXPBASE)\lib\wxp*\wdmsec.lib C:\Programming\mylib\mylib.lib
>
>INCLUDES=C:\IFSKit\src\filesys\inc
>
>SOURCES=mydriver.c <br>> mydriver.rc
>
>and it always has an error :
>mydriver.obj : error LNK2019: unresolved external symbol _set_up@16
>referenced in function _dothis@0
>
>set_up function call has be delcared in the .h file
>
>hope you can help
>
>thank you
>
>cheers,
>vincent
>
>
>Get 10mb of inbox space with MSN Hotmail Extra Storage
>http://join.msn.com/?pgmarket=en-sg
>
>
>—
>Questions? First check the IFS FAQ at
>https://www.osronline.com/article.cfm?id=17
>
>You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>Questions? First check the IFS FAQ at
>https://www.osronline.com/article.cfm?id=17
>
>You are currently subscribed to ntfsd as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com


Download games, logos, wallpapers and lots more at MSN Mobile!
http://www.msn.com.sg/mobile/


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

hi,

thanks
it worked
8)

From: “Kiran Joshi”
>Reply-To: “Windows File Systems Devs Interest List”
>To: “Windows File Systems Devs Interest List”
>Subject: [ntfsd] RE: how to create my own library files to be linked to my
>driver?
>Date: Tue, 9 Dec 2003 15:38:55 +0530
>
>Hello Vincent,
>
>Now what is happening is that the user application is expecting cdecl and
>you are using stdcall.
>I think what you will have to do is declare these functions as stdcall in
>the header file and use this same header file in both places user/kernel.
>This will ensure that you use only single calling convention at both places
>and the user application and driver should both compile properly using the
>same lib file.
>
>thanks
>-Kiran
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com]On Behalf Of vincent gambit
>Sent: Tuesday, December 09, 2003 3:29 PM
>To: Windows File Systems Devs Interest List
>Subject: [ntfsd] RE: how to create my own library files to be linked to
>my driver?
>
>
>hi,
>
>Thanks for your reply
>it worked for the driver now
>however it didnt work for my VC now.
>I am sharing this lib file for the VC and my driver.
>
>How can have a single lib file which can be used for both VC and driver?
>
>Thank You!
>
>cheers,
>vincent
>
>
> >From: “Kiran Joshi”
> >Reply-To: “Windows File Systems Devs Interest List”
> >To: “Windows File Systems Devs Interest List”
> >Subject: [ntfsd] RE: how to create my own library files to be linked to
>my
> >driver?
> >Date: Tue, 9 Dec 2003 14:46:00 +0530
> >
> >Check the calling convention. By default VC uses cdecl and the drivers
> >expect
stdcall.
> >thanks
> >-Kiran
> >
> >-----Original Message-----
> >From: xxxxx@lists.osr.com
> >[mailto:xxxxx@lists.osr.com]On Behalf Of vincent gambit
> >Sent: Tuesday, December 09, 2003 2:29 PM
> >To: Windows File Systems Devs Interest List
> >Subject: [ntfsd] how to create my own library files to be linked to my
> >driver?
> >
> >
> >Hi,
> >
> >I created a lib file (not using MFC) using visual c.
> >And i tried to link this lib in my driver.
> >I have included the .h file for this lib in my driver
> >and the source file :
> >ARGETNAME=mydriver
> >TARGETPATH=obj
> >TARGETTYPE=DRIVER
> >
> >TARGETLIBS=$(WXPBASE)\lib\wxp*\wdmsec.lib C:\Programming\mylib\mylib.lib
> >
> >INCLUDES=C:\IFSKit\src\filesys\inc
> >
> >SOURCES=mydriver.c <br>> > mydriver.rc
> >
> >and it always has an error :
> >mydriver.obj : error LNK2019: unresolved external symbol _set_up@16
> >referenced in function _dothis@0
> >
> >set_up function call has be delcared in the .h file
> >
> >hope you can help
> >
> >thank you
> >
> >cheers,
> >vincent
> >
> >
> >Get 10mb of inbox space with MSN Hotmail Extra Storage
> >http://join.msn.com/?pgmarket=en-sg
> >
> >
> >—
> >Questions? First check the IFS FAQ at
> >https://www.osronline.com/article.cfm?id=17
> >
> >You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >—
> >Questions? First check the IFS FAQ at
> >https://www.osronline.com/article.cfm?id=17
> >
> >You are currently subscribed to ntfsd as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

>Download games, logos, wallpapers and lots more at MSN Mobile!
>http://www.msn.com.sg/mobile/
>
>
>—
>Questions? First check the IFS FAQ at
>https://www.osronline.com/article.cfm?id=17
>
>You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>—
>Questions? First check the IFS FAQ at
>https://www.osronline.com/article.cfm?id=17
>
>You are currently subscribed to ntfsd as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com

_________________________________________________________________
Keep track of Singapore & Malaysia stock prices.
http://www.msn.com.sg/money/

I have a question. Because the lib is both used is kernel mode and use mode,
how can I allocate a buffer in this lib.In use mode we can use
“ExAllocatePool”,
but in kenerl mode we shoud use “new”.

I am sorry for my poor English
“vincent gambit”
>
> hi,
>
> thanks
> it worked
> 8)
>
>
> >From: “Kiran Joshi”
> >Reply-To: “Windows File Systems Devs Interest List”
> >To: “Windows File Systems Devs Interest List”
> >Subject: [ntfsd] RE: how to create my own library files to be linked to
my
> >driver?
> >Date: Tue, 9 Dec 2003 15:38:55 +0530
> >
> >Hello Vincent,
> >
> >Now what is happening is that the user application is expecting cdecl and
> >you are using stdcall.
> >I think what you will have to do is declare these functions as stdcall in
> >the header file and use this same header file in both places user/kernel.
> >This will ensure that you use only single calling convention at both
places
> >and the user application and driver should both compile properly using
the
> >same lib file.
> >
> >thanks
> >-Kiran
> >-----Original Message-----
> >From: xxxxx@lists.osr.com
> >[mailto:xxxxx@lists.osr.com]On Behalf Of vincent gambit
> >Sent: Tuesday, December 09, 2003 3:29 PM
> >To: Windows File Systems Devs Interest List
> >Subject: [ntfsd] RE: how to create my own library files to be linked to
> >my driver?
> >
> >
> >hi,
> >
> >Thanks for your reply
> >it worked for the driver now
> >however it didnt work for my VC now.
> >I am sharing this lib file for the VC and my driver.
> >
> >How can have a single lib file which can be used for both VC and driver?
> >
> >Thank You!
> >
> >cheers,
> >vincent
> >
> >
> > >From: “Kiran Joshi”
> > >Reply-To: “Windows File Systems Devs Interest List”

> > >To: “Windows File Systems Devs Interest List”
> > >Subject: [ntfsd] RE: how to create my own library files to be linked to
> >my
> > >driver?
> > >Date: Tue, 9 Dec 2003 14:46:00 +0530
> > >
> > >Check the calling convention. By default VC uses cdecl and the
drivers
> > >expect
stdcall.
> > >thanks
> > >-Kiran
> > >
> > >-----Original Message-----
> > >From: xxxxx@lists.osr.com
> > >[mailto:xxxxx@lists.osr.com]On Behalf Of vincent gambit
> > >Sent: Tuesday, December 09, 2003 2:29 PM
> > >To: Windows File Systems Devs Interest List
> > >Subject: [ntfsd] how to create my own library files to be linked to my
> > >driver?
> > >
> > >
> > >Hi,
> > >
> > >I created a lib file (not using MFC) using visual c.
> > >And i tried to link this lib in my driver.
> > >I have included the .h file for this lib in my driver
> > >and the source file :
> > >ARGETNAME=mydriver
> > >TARGETPATH=obj
> > >TARGETTYPE=DRIVER
> > >
> > >TARGETLIBS=$(WXPBASE)\lib\wxp*\wdmsec.lib
C:\Programming\mylib\mylib.lib
> > >
> > >INCLUDES=C:\IFSKit\src\filesys\inc
> > >
> > >SOURCES=mydriver.c <br>> > > mydriver.rc
> > >
> > >and it always has an error :
> > >mydriver.obj : error LNK2019: unresolved external symbol _set_up@16
> > >referenced in function _dothis@0
> > >
> > >set_up function call has be delcared in the .h file
> > >
> > >hope you can help
> > >
> > >thank you
> > >
> > >cheers,
> > >vincent
> > >
> > >
> > >Get 10mb of inbox space with MSN Hotmail Extra Storage
> > >http://join.msn.com/?pgmarket=en-sg
> > >
> > >
> > >—
> > >Questions? First check the IFS FAQ at
> > >https://www.osronline.com/article.cfm?id=17
> > >
> > >You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com
> > >To unsubscribe send a blank email to xxxxx@lists.osr.com
> > >
> > >
> > >—
> > >Questions? First check the IFS FAQ at
> > >https://www.osronline.com/article.cfm?id=17
> > >
> > >You are currently subscribed to ntfsd as: xxxxx@hotmail.com
> > >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >

> >Download games, logos, wallpapers and lots more at MSN Mobile!
> >http://www.msn.com.sg/mobile/
> >
> >
> >—
> >Questions? First check the IFS FAQ at
> >https://www.osronline.com/article.cfm?id=17
> >
> >You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >—
> >Questions? First check the IFS FAQ at
> >https://www.osronline.com/article.cfm?id=17
> >
> >You are currently subscribed to ntfsd as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> _________________________________________________________________
> Keep track of Singapore & Malaysia stock prices.
> http://www.msn.com.sg/money/
>
>
>

Use “new” and link another portability library that defines “new” for
kernel mode. However, be very-very careful with writing C++ code that
is doing new this, new that all over the place. The kernel address
space will be carved to pieces and eventually the system can run out of
usable memory blocks.

-----Original Message-----
From: Robin Zhua [mailto:xxxxx@njinasoft.com]
Sent: Thursday, December 11, 2003 8:42 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Re: how to create my own library files to be linked to
my driver?

I have a question. Because the lib is both used is kernel mode and use
mode,
how can I allocate a buffer in this lib.In use mode we can use
“ExAllocatePool”,
but in kenerl mode we shoud use “new”.

I am sorry for my poor English
“vincent gambit”
>
> hi,
>
> thanks
> it worked
> 8)
>
>
> >From: “Kiran Joshi”
> >Reply-To: “Windows File Systems Devs Interest List”

> >To: “Windows File Systems Devs Interest List”
> >Subject: [ntfsd] RE: how to create my own library files to be linked
to
my
> >driver?
> >Date: Tue, 9 Dec 2003 15:38:55 +0530
> >
> >Hello Vincent,
> >
> >Now what is happening is that the user application is expecting cdecl
and
> >you are using stdcall.
> >I think what you will have to do is declare these functions as
stdcall in
> >the header file and use this same header file in both places
user/kernel.
> >This will ensure that you use only single calling convention at both
places
> >and the user application and driver should both compile properly
using
the
> >same lib file.
> >
> >thanks
> >-Kiran
> >-----Original Message-----
> >From: xxxxx@lists.osr.com
> >[mailto:xxxxx@lists.osr.com]On Behalf Of vincent gambit
> >Sent: Tuesday, December 09, 2003 3:29 PM
> >To: Windows File Systems Devs Interest List
> >Subject: [ntfsd] RE: how to create my own library files to be linked
to
> >my driver?
> >
> >
> >hi,
> >
> >Thanks for your reply
> >it worked for the driver now
> >however it didnt work for my VC now.
> >I am sharing this lib file for the VC and my driver.
> >
> >How can have a single lib file which can be used for both VC and
driver?
> >
> >Thank You!
> >
> >cheers,
> >vincent
> >
> >
> > >From: “Kiran Joshi”
> > >Reply-To: “Windows File Systems Devs Interest List”

> > >To: “Windows File Systems Devs Interest List”
> > >Subject: [ntfsd] RE: how to create my own library files to be
linked to
> >my
> > >driver?
> > >Date: Tue, 9 Dec 2003 14:46:00 +0530
> > >
> > >Check the calling convention. By default VC uses cdecl and the
drivers
> > >expect
stdcall.
> > >thanks
> > >-Kiran
> > >
> > >-----Original Message-----
> > >From: xxxxx@lists.osr.com
> > >[mailto:xxxxx@lists.osr.com]On Behalf Of vincent
gambit
> > >Sent: Tuesday, December 09, 2003 2:29 PM
> > >To: Windows File Systems Devs Interest List
> > >Subject: [ntfsd] how to create my own library files to be linked to
my
> > >driver?
> > >
> > >
> > >Hi,
> > >
> > >I created a lib file (not using MFC) using visual c.
> > >And i tried to link this lib in my driver.
> > >I have included the .h file for this lib in my driver
> > >and the source file :
> > >ARGETNAME=mydriver
> > >TARGETPATH=obj
> > >TARGETTYPE=DRIVER
> > >
> > >TARGETLIBS=$(WXPBASE)\lib\wxp*\wdmsec.lib
C:\Programming\mylib\mylib.lib
> > >
> > >INCLUDES=C:\IFSKit\src\filesys\inc
> > >
> > >SOURCES=mydriver.c <br>> > > mydriver.rc
> > >
> > >and it always has an error :
> > >mydriver.obj : error LNK2019: unresolved external symbol _set_up@16
> > >referenced in function _dothis@0
> > >
> > >set_up function call has be delcared in the .h file
> > >
> > >hope you can help
> > >
> > >thank you
> > >
> > >cheers,
> > >vincent
> > >
> > >
> > >Get 10mb of inbox space with MSN Hotmail Extra Storage
> > >http://join.msn.com/?pgmarket=en-sg
> > >
> > >
> > >—
> > >Questions? First check the IFS FAQ at
> > >https://www.osronline.com/article.cfm?id=17
> > >
> > >You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com
> > >To unsubscribe send a blank email to
xxxxx@lists.osr.com
> > >
> > >
> > >—
> > >Questions? First check the IFS FAQ at
> > >https://www.osronline.com/article.cfm?id=17
> > >
> > >You are currently subscribed to ntfsd as: xxxxx@hotmail.com
> > >To unsubscribe send a blank email to
xxxxx@lists.osr.com
> >
> >

> >Download games, logos, wallpapers and lots more at MSN Mobile!
> >http://www.msn.com.sg/mobile/
> >
> >
> >—
> >Questions? First check the IFS FAQ at
> >https://www.osronline.com/article.cfm?id=17
> >
> >You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >—
> >Questions? First check the IFS FAQ at
> >https://www.osronline.com/article.cfm?id=17
> >
> >You are currently subscribed to ntfsd as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> _________________________________________________________________
> Keep track of Singapore & Malaysia stock prices.
> http://www.msn.com.sg/money/
>
>
>


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@exagrid.com
To unsubscribe send a blank email to xxxxx@lists.osr.com