Makefile errors in wdk project build

You need a file named ‘sources’ to work with build. Do you have this?

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.it
Sent: Tuesday, October 25, 2011 5:31 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Makefile errors in wdk project build

The original source is:

http://pastebin.com/xC7LHYPu

but I obtain the same error with a simple:

http://pastebin.com/Lwr2uTiF

Thanks, Numa


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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’ve it only in the simple project directory, not in the minifilter one

And a makefile. He said that he doesn’t have a makefile.

Bill

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Martin O’Brien
Sent: Tuesday, October 25, 2011 8:52 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Makefile errors in wdk project build

You need a file named ‘sources’ to work with build. Do you have this?

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.it
Sent: Tuesday, October 25, 2011 5:31 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Makefile errors in wdk project build

The original source is:

http://pastebin.com/xC7LHYPu

but I obtain the same error with a simple:

http://pastebin.com/Lwr2uTiF

Thanks, Numa


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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

Technically, you don’t need one anymore.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bill Wandel
Sent: Tuesday, October 25, 2011 8:01 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Makefile errors in wdk project build

And a makefile. He said that he doesn’t have a makefile.

Bill

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Martin O’Brien
Sent: Tuesday, October 25, 2011 8:52 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Makefile errors in wdk project build

You need a file named ‘sources’ to work with build. Do you have this?

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.it
Sent: Tuesday, October 25, 2011 5:31 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Makefile errors in wdk project build

The original source is:

http://pastebin.com/xC7LHYPu

but I obtain the same error with a simple:

http://pastebin.com/Lwr2uTiF

Thanks, Numa


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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

So how can I solve my problem?

Once again, what is the contents of your SOURCES file?

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.it
Sent: Tuesday, October 25, 2011 9:55 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Makefile errors in wdk project build

So how can I solve my problem?


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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

Oh I’m sorry, this is:

TARGETNAME=driver
TARGETTYPE=DRIVER

SOURCES=stdafx.cpp \
driver.cpp

So maybe the problem is that I dont have any stdafx.cpp file in my directory?

And, why in the other project I dont have any sources file?

Perhaps I’m late to th e conversation, but that file is normally NOT used in kernel development, and indicates you may be trying to use User mode files and libraries in a driver. Not good, and covered so many times in this list it “taint funny McGee.” Sorry ? too much time spent on Radio Classics.

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

On Oct 25, 2011, at 12:31 PM, xxxxx@yahoo.it wrote:

Oh I’m sorry, this is:

TARGETNAME=driver
TARGETTYPE=DRIVER

SOURCES=stdafx.cpp \
driver.cpp

So maybe the problem is that I dont have any stdafx.cpp file in my directory?

And, why in the other project I dont have any sources file?


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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 have no idea why you don’t have a sources file in your other project, but
you need one.

Yes, the lack of stdafx.cpp will be a problem, but it’s not your problem
now.

I suspect that you also lack a dirs file in the parent directory that
contains these two projects.

I don’t know how you created this stuff, but you need to start over. I
think you mentioned using some visual project generator or something. I
would suggest that you not do that and start with a WDK sample.

Good luck,

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.it
Sent: Tuesday, October 25, 2011 10:32 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Makefile errors in wdk project build

Oh I’m sorry, this is:

TARGETNAME=driver
TARGETTYPE=DRIVER

SOURCES=stdafx.cpp \
driver.cpp

So maybe the problem is that I dont have any stdafx.cpp file in my
directory?

And, why in the other project I dont have any sources file?


NTFSD is sponsored by OSR

For our schedule of debugging and file system 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

Hello Gary, thanks for your reply. So, the first source is pretty simple (just a DriverEntry with a DbgPrint() and an Unload routine), and the only header inluded is ntddk.h, so I’m not trying to use user libraries. Is a problem with NMAKE, but I really dont know how to solve it.

mm, I just use the wizard stuff for the project start! Well, thanks for your time. I hope to solve it soon!

Numa

0/26/11, xxxxx@yahoo.it wrote:
> Hello Gary, thanks for your reply. So, the first source is pretty simple
> (just a DriverEntry with a DbgPrint() and an Unload routine), and the only
> header inluded is ntddk.h, so I’m not trying to use user libraries. Is a
> problem with NMAKE, but I really dont know how to solve it.
>
> mm, I just use the wizard stuff for the project start! Well, thanks for your
> time. I hope to solve it soon!

some repeated questioning and lack of clear answer with a i hope to
solve it soon makes me write a little tut

yes a simple driver with driver entry dbg print and unload routine can
look like this

{CODE}

#include <ntddk.h>

DRIVER_INITIALIZE DriverEntry;
DRIVER_UNLOAD DriverUnload;

void
DriverUnload(
PDRIVER_OBJECT DriverObject
)
{
DbgPrint(“Example Driver unloading\n”);
}

NTSTATUS
DriverEntry(
in PDRIVER_OBJECT DriverObject,
in PUNICODE_STRING RegistryPath
)
{
DriverObject->DriverUnload = DriverUnload;
DbgPrint("Hello World!\n called from Example.sys\n ");
return STATUS_SUCCESS;
}
{code}

and that directory must contain a file named sources (SIMPLY SOURCES
NOT SOURCES.INC NOT SOURCES.BLAH NOT SOURSES.WHATEVER JUST PLAIN AND
SIMPLE

sources

which must contain at the minimum these lines

TARGETNAME=myfancydriverthatmakesmousedancewithcatondesktop
TARGETTYPE=DRIVER
TARGETPATH=obj
SOURCES = example.c

you should choose one of build environment like

C:\WINDOWS\system32\cmd.exe /k C:\WinDDK\7600.16385.1\bin\setenv.bat
C:\WinDDK\7600.16385.1\ fre x86 WLH

navigate to the folder that contains the

c file and sources file and issue a build

it should compile and link fine

and produce a sys file with symbols

see below for a paste of the process

myfancydriverthatmakesmousedancewithcatondesktop:&gt;dir /b
example.c
sources

myfancydriverthatmakesmousedancewithcatondesktop:&gt;type example.c
#include <ntddk.h>

DRIVER_INITIALIZE DriverEntry;
DRIVER_UNLOAD DriverUnload;

void
DriverUnload(
PDRIVER_OBJECT DriverObject
)
{
DbgPrint(“Example Driver unloading\n”);
}

NTSTATUS
DriverEntry(
in PDRIVER_OBJECT DriverObject,
in PUNICODE_STRING RegistryPath
)
{
DriverObject->DriverUnload = DriverUnload;
DbgPrint("Hello World!\n called from Example.sys
\n ");
return STATUS_SUCCESS;
}
myfancydriverthatmakesmousedancewithcatondesktop:&gt;type sources

TARGETNAME=myfancydriverthatmakesmousedancewithcatondesktop
TARGETTYPE=DRIVER
TARGETPATH=obj
SOURCES = example.c

myfancydriverthatmakesmousedancewithcatondesktop:&gt;build

BUILD: Compile and Link for x86
BUILD: Loading c:\winddk\7600.16385.1\build.dat…
BUILD: Computing Include file dependencies:
BUILD: Start time: Thu Oct 27 11:20:34 2011
BUILD: Examining c:\winddk\7600.16385.1\src \example directory
for files to compile.
c:\winddk\7600.16385.1\src*
** \example
Invalidating OACR warn
ing log for ‘WDKSamples:x86fre’
BUILD: Saving c:\winddk\7600.16385.1\build.dat…
BUILD: Compiling and Linking
c:\winddk\7600.16385.1\src\ ************************ \examp
le directory
Configuring OACR for ‘WDKSamples:x86fre’ -
Compiling - example.c
Linking Executable - objfre_wlh_x86\i386\myfancydriverthatmakesmousedancewithcat
ondesktop.sys
BUILD: Finish time: Thu Oct 27 11:20:35 2011
BUILD: Done

3 files compiled
1 executable built

myfancydriverthatmakesmousedancewithcatondesktop:&gt;dir /b
buildfre_wlh_x86.log
example.c
objfre_wlh_x86
sources

myfancydriverthatmakesmousedancewithcatondesktop:&gt;tree /a /f
Folder PATH listing
Volume serial number is 9836-92E3
C:.
| buildfre_wlh_x86.log
| example.c
| sources
|
-–objfre_wlh_x86
-–i386
example.obj
myfancydriverthatmakesmousedancewithcatondesktop.pdb
myfancydriverthatmakesmousedancewithcatondesktop.sys
vc90.pdb
_objects.mac

myfancydriverthatmakesmousedancewithcatondesktop:&gt;</ntddk.h></ntddk.h>

i forgot to add only these two files are technically necessary
makefile is not needed at least not for small dbgprint only driver

On 10/27/11, raj_r wrote:
> 0/26/11, xxxxx@yahoo.it wrote:
>> Hello Gary, thanks for your reply. So, the first source is pretty simple
>> (just a DriverEntry with a DbgPrint() and an Unload routine), and the
>> only
>> header inluded is ntddk.h, so I’m not trying to use user libraries. Is a
>> problem with NMAKE, but I really dont know how to solve it.
>>
>> mm, I just use the wizard stuff for the project start! Well, thanks for
>> your
>> time. I hope to solve it soon!
>
>
> some repeated questioning and lack of clear answer with a i hope to
> solve it soon makes me write a little tut
>
>
> yes a simple driver with driver entry dbg print and unload routine can
> look like this
>
>
> {CODE}
>
> #include <ntddk.h>
>
> DRIVER_INITIALIZE DriverEntry;
> DRIVER_UNLOAD DriverUnload;
>
>
> void
> DriverUnload(
> PDRIVER_OBJECT DriverObject
> )
> {
> DbgPrint(“Example Driver unloading\n”);
> }
>
>
>
> NTSTATUS
> DriverEntry(
> in PDRIVER_OBJECT DriverObject,
>
in PUNICODE_STRING RegistryPath
> )
> {
> DriverObject->DriverUnload = DriverUnload;
> DbgPrint("Hello World!\n called from Example.sys\n ");
> return STATUS_SUCCESS;
> }
> {code}
>
>
> and that directory must contain a file named sources (SIMPLY SOURCES
> NOT SOURCES.INC NOT SOURCES.BLAH NOT SOURSES.WHATEVER JUST PLAIN AND
> SIMPLE
>
> sources
>
> which must contain at the minimum these lines
>
> TARGETNAME=myfancydriverthatmakesmousedancewithcatondesktop
> TARGETTYPE=DRIVER
> TARGETPATH=obj
> SOURCES = example.c
>
>
> you should choose one of build environment like
>
> C:\WINDOWS\system32\cmd.exe /k C:\WinDDK\7600.16385.1\bin\setenv.bat
> C:\WinDDK\7600.16385.1\ fre x86 WLH
>
> navigate to the folder that contains the
>
> c file and sources file and issue a build
>
> it should compile and link fine
>
> and produce a sys file with symbols
>
>
> see below for a paste of the process
>
>
>
> myfancydriverthatmakesmousedancewithcatondesktop:&gt;dir /b
> example.c
> sources
>
> myfancydriverthatmakesmousedancewithcatondesktop:&gt;type example.c
> #include <ntddk.h>
>
> DRIVER_INITIALIZE DriverEntry;
> DRIVER_UNLOAD DriverUnload;
>
>
> void
> DriverUnload(
> PDRIVER_OBJECT DriverObject
> )
> {
> DbgPrint(“Example Driver unloading\n”);
> }
>
>
>
> NTSTATUS
> DriverEntry(
> in PDRIVER_OBJECT DriverObject,
>
in PUNICODE_STRING RegistryPath
> )
> {
> DriverObject->DriverUnload = DriverUnload;
> DbgPrint("Hello World!\n called from
> Example.sys
> \n ");
> return STATUS_SUCCESS;
> }
> myfancydriverthatmakesmousedancewithcatondesktop:&gt;type sources
>
> TARGETNAME=myfancydriverthatmakesmousedancewithcatondesktop
> TARGETTYPE=DRIVER
> TARGETPATH=obj
> SOURCES = example.c
>
>
> myfancydriverthatmakesmousedancewithcatondesktop:&gt;build
>
> BUILD: Compile and Link for x86
> BUILD: Loading c:\winddk\7600.16385.1\build.dat…
> BUILD: Computing Include file dependencies:
> BUILD: Start time: Thu Oct 27 11:20:34 2011
> BUILD: Examining c:\winddk\7600.16385.1\src \example
> directory
> for files to compile.
> c:\winddk\7600.16385.1\src*
** \example
> Invalidating OACR warn
> ing log for ‘WDKSamples:x86fre’
> BUILD: Saving c:\winddk\7600.16385.1\build.dat…
> BUILD: Compiling and Linking
> c:\winddk\7600.16385.1\src\ ************************ \examp
> le directory
> Configuring OACR for ‘WDKSamples:x86fre’ -
> Compiling - example.c
> Linking Executable -
> objfre_wlh_x86\i386\myfancydriverthatmakesmousedancewithcat
> ondesktop.sys
> BUILD: Finish time: Thu Oct 27 11:20:35 2011
> BUILD: Done
>
> 3 files compiled
> 1 executable built
>
> myfancydriverthatmakesmousedancewithcatondesktop:&gt;dir /b
> buildfre_wlh_x86.log
> example.c
> objfre_wlh_x86
> sources
>
> myfancydriverthatmakesmousedancewithcatondesktop:&gt;tree /a /f
> Folder PATH listing
> Volume serial number is 9836-92E3
> C:.
> | buildfre_wlh_x86.log
> | example.c
> | sources
> |
> -–objfre_wlh_x86
> -–i386
> example.obj
> myfancydriverthatmakesmousedancewithcatondesktop.pdb
> myfancydriverthatmakesmousedancewithcatondesktop.sys
> vc90.pdb
> _objects.mac
>
>
> myfancydriverthatmakesmousedancewithcatondesktop:&gt;
>


thanks and regards

raj_r</ntddk.h></ntddk.h>