Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MS DDK sample project

30 views
Skip to first unread message

Michael Pierce

unread,
Feb 27, 2004, 11:04:21 AM2/27/04
to
Does anyone know how to build an MS DDK sample project (such as oemps) that
has been modified to include api's that are
definned in ntddk? The build environment would be XP, DDK 2600.1106, Feb
2003 SDK, and VC6.0.


Ashwin [MS]

unread,
Feb 27, 2004, 5:39:01 PM2/27/04
to
What specific APIs are you talking about? Are they kernel mode functions?
Also, what do you mean by VC6.0 when you describe your build environment?
You should be using the build environment that is part of the DDK itself
instead of using the separate SDK and VC build environments.

--
- Ashwin

Microsoft Printing, Imaging and Fax Team
This posting is provided "AS IS" with no warranties, and confers no rights.

"Michael Pierce" <Michael.Pierce@_RE_MOVE_tentechnologies.com> wrote in
message news:9UJ%b.85904$n62....@twister.nyroc.rr.com...

Gary G. Little

unread,
Feb 27, 2004, 5:49:35 PM2/27/04
to
I think I have told you twice now. For the third time you create a source
module that includes NTDDK.H. You then create a header file that allows the
remainder of your source to call functions in this lateral edge that makes
calls into the DDK API.

--
Gary G. Little
Seagate Technologies, LLC

"Michael Pierce" <Michael.Pierce@_RE_MOVE_tentechnologies.com> wrote in
message news:9UJ%b.85904$n62....@twister.nyroc.rr.com...

James Antognini [MSFT]

unread,
Feb 27, 2004, 5:49:40 PM2/27/04
to
APIs are made available in build via the sources file under INCLUDES -- if
one needs non-default header libraries -- and under TARGETLIBS if one needs
non-default import libraries.

--
James Antognini
Windows DDK Support

This posting is provided "AS IS" with no warranties, and confers no rights.

"Michael Pierce" <Michael.Pierce@_RE_MOVE_tentechnologies.com> wrote in
message news:9UJ%b.85904$n62....@twister.nyroc.rr.com...

Michael Pierce

unread,
Mar 1, 2004, 8:07:25 AM3/1/04
to
For a couple of weeks I have been trying to use some api's that are defined
in ntddk.h, and have had no success. If for exapmle I modify the pscommand
method in command.cpp (oemps.dll - DDK sample) by adding something simple
like:

LARGE_INTEGER time;

KeQuerySystemTime(&time);

I can't get it to compile due to an unknown identifier error. If I add
#include <ntddk.h> to command.cpp, I get a ton of 'redefinition errors when
I try to compile.

When I mentioned VC6 in my build environment, I did so because I am under
the impression that the DDK uses the compiler and linker that comes with
VC6. And yes, I am using the checked/free command window that gets
installed with the DDK.

Thank you!!!


"Ashwin [MS]" <ash...@online.microsoft.com> wrote in message
news:e2fKAKY$DHA....@TK2MSFTNGP12.phx.gbl...

Michael Pierce

unread,
Mar 1, 2004, 8:17:32 AM3/1/04
to
I should also mention that ntddk.h is found in
'C:\DDK\WINDDK\2600.1106\inc\ddk\wxp' and not
'C:\DDK\WINDDK\2600.1106\inc\wxp', which is the std. header file directory.


"Ashwin [MS]" <ash...@online.microsoft.com> wrote in message
news:e2fKAKY$DHA....@TK2MSFTNGP12.phx.gbl...

Gary G. Little

unread,
Mar 1, 2004, 9:45:28 AM3/1/04
to
NTDDK.H is a header file equivalent to Windows.H and is specific to device
driver development. You ONLY include NTDDK.H when you are building a device
driver that will load and run in the kernel. If you are NOT building a
kernel mode device driver you NEVER include NTDDK.H. There are header files
such as NTDDSCSI that define special IOCTL codes that are at times needed in
an application. For those special needs you include only the header files
that are called out in the documentation.

There are kerenl subsystems, such as NDIS and SCSI, that may or may not do
an underlying, but restricted, include of NTDDK.H. You do NOT include
NTDDK.H in builds for those subsystems. Those subsystems, for their own
defined reasons, restrict the use of the DDK, define many of the variables
and or include many of the nested header files found in NTDDK.H.

For kernel mode subsystems that do not explicitly include NTDDK there is a
method of providing full NTDDK support by creating a source module that
includes NTDDK and exports functionality to the rest of the kernel component
that is being built. I call this a lateral edge since mostly it abrogates
the ability of the component to pass WHQL.

Bottom line ... if you are NOT building a kernel mode device driver or DLL,
then you NEVER include NTDDK.H. If you are building a kernel subsystem
driver that provides a restricted NTDDK interface then you have to provide
NTDDK functionality by exporting your own functionality from a module that
includes NTDDK. From what I can gather after spending a few minutes looking
at the header file trail for OEMPS, you fall in the latter category. You
cannot explicitly include NTDDK, you have to hide it in that lateral edge
and export calls into this edge.

Any questions?

--
Gary G. Little
Seagate Technologies, LLC

"Michael Pierce" <Michael.Pierce@_RE_MOVE_tentechnologies.com> wrote in
message news:hAG0c.93882$n62....@twister.nyroc.rr.com...

Michael Pierce

unread,
Mar 1, 2004, 10:46:20 AM3/1/04
to
Thank you very much for that explanation. Now I fully understand the point
you have been trying to get across. Being an application layer person, and
very new to kernel-mode, I was 'sure' that there had to be a way to include
NTDDK APIS without having to create a 'lateral' module. Anyhow, now that
you have managed to beat it into me, do you recommend using a static or
dynamic 'lateral' module?

Thanks again for all of you time!!!!!


"Gary G. Little" <gary.g.lit...@seagate.com> wrote in message
news:c0I0c.3302$RN6...@newssvr22.news.prodigy.com...

Gary G. Little

unread,
Mar 1, 2004, 5:51:15 PM3/1/04
to
If you ain't in the kernel, don't bother, you still can't do it. If your
building a kernel DLL that will be used by kernel components, then I'd keep
it dynamic.

--
Gary G. Little
Seagate Technologies, LLC

"Michael Pierce" <Michael.Pierce@_RE_MOVE_tentechnologies.com> wrote in

message news:gVI0c.95047$n62....@twister.nyroc.rr.com...

Michael Pierce

unread,
Mar 3, 2004, 8:41:53 AM3/3/04
to
Gary,
I just wanted to say thank you for all of your help. I was able to get a
custom dll hooked into my kernel mode driver.

Best regards,
Michael Pierce

"Gary G. Little" <gary.g.lit...@seagate.com> wrote in message

news:D7P0c.3035$OC3.90...@newssvr11.news.prodigy.com...

0 new messages