public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Call "undocumented" NTDLL functions with Cygwin/gcc?
@ 2008-11-01  7:50 David Arnstein
  2008-11-01  9:14 ` Corinna Vinschen
  0 siblings, 1 reply; 6+ messages in thread
From: David Arnstein @ 2008-11-01  7:50 UTC (permalink / raw)
  To: cygwin

I would like to use some of the "undocumented" NTDLL functions from
within a C or C++ program. I would like to compile this program from
Cygwin's C or C++ compiler.

The functions I refer to involve Registry operations, such as 
NtQueryValueKey() and NtEnumerateValueKey(). I found some sparse
documentation here:
http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/NT%20Objects/Key/NtQueryValueKey.html

I could not find these under /usr/include. Any suggestions?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Call "undocumented" NTDLL functions with Cygwin/gcc?
  2008-11-01  7:50 Call "undocumented" NTDLL functions with Cygwin/gcc? David Arnstein
@ 2008-11-01  9:14 ` Corinna Vinschen
  2008-11-01 14:15   ` Christopher Faylor
  0 siblings, 1 reply; 6+ messages in thread
From: Corinna Vinschen @ 2008-11-01  9:14 UTC (permalink / raw)
  To: cygwin

On Nov  1 03:49, David Arnstein wrote:
> I would like to use some of the "undocumented" NTDLL functions from
> within a C or C++ program. I would like to compile this program from
> Cygwin's C or C++ compiler.
> 
> The functions I refer to involve Registry operations, such as 
> NtQueryValueKey() and NtEnumerateValueKey(). I found some sparse
> documentation here:
> http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/NT%20Objects/Key/NtQueryValueKey.html
> 
> I could not find these under /usr/include. Any suggestions?

Many of the ntdll functions and types are defined under
/usr/include/w32api/ddk.  The definitions are not complete so expect
that you have to create your own header to define missing symbols.
Patches to extend the files in w32api (maintained by the MingW team) are
always welcome.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Call "undocumented" NTDLL functions with Cygwin/gcc?
  2008-11-01  9:14 ` Corinna Vinschen
@ 2008-11-01 14:15   ` Christopher Faylor
  2008-11-01 17:49     ` David Arnstein
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher Faylor @ 2008-11-01 14:15 UTC (permalink / raw)
  To: cygwin

On Sat, Nov 01, 2008 at 10:14:44AM +0100, Corinna Vinschen wrote:
>On Nov  1 03:49, David Arnstein wrote:
>>I would like to use some of the "undocumented" NTDLL functions from
>>within a C or C++ program.  I would like to compile this program from
>>Cygwin's C or C++ compiler.
>>
>>The functions I refer to involve Registry operations, such as
>>NtQueryValueKey() and NtEnumerateValueKey().  I found some sparse
>>documentation here:
>>http://undocumented.ntinternals.net/UserMode/Undocumented%20Functions/NT%20Objects/Key/NtQueryValueKey.html
>>
>>I could not find these under /usr/include.  Any suggestions?
>
>Many of the ntdll functions and types are defined under
>/usr/include/w32api/ddk.  The definitions are not complete so expect
>that you have to create your own header to define missing symbols.
>Patches to extend the files in w32api (maintained by the MingW team)
>are always welcome.

But they don't go to this mailing list.  Check out mingw.org.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Call "undocumented" NTDLL functions with Cygwin/gcc?
  2008-11-01 14:15   ` Christopher Faylor
@ 2008-11-01 17:49     ` David Arnstein
  2008-11-01 20:10       ` Brian Dessent
  0 siblings, 1 reply; 6+ messages in thread
From: David Arnstein @ 2008-11-01 17:49 UTC (permalink / raw)
  To: cygwin

> On Sat, Nov 01, 2008 at 10:14:44AM +0100, Corinna Vinschen wrote:
> >Many of the ntdll functions and types are defined under
> >/usr/include/w32api/ddk.  The definitions are not complete so expect
> >that you have to create your own header to define missing symbols.
> >Patches to extend the files in w32api (maintained by the MingW team)
> >are always welcome.
 
On Sat, Nov 01, 2008 at 10:13:57AM -0400, Christopher Faylor wrote:
> But they don't go to this mailing list.  Check out mingw.org.

OK, I will submit any patches to MingW instead of Cygin. But, back to
Cygwin. The directory /usr/include/w32api/ddk does not seem to be
available when I use "gcc -mno-cygwin." I mean, I have this line of code 
in my source file:
	#include <w32api/ddk/ntapi.h>
This is how I am trying to compile:
	gcc -mno-cygwin -Wall -g bodge.c -o bodge
	bodge.c:2:30: w32api/ddk/ntapi.h: No such file or directory

So what is the proper way to use the DDK functions in Cygwin? You
mention MingW, so I assume that I should use the MingW compiler (gcc
-mno-cygwin). Do I assume wrong?
-- 
David Arnstein                       (00)
arnstein@pobox.com                 {{   }}
                                     ^^

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Call "undocumented" NTDLL functions with Cygwin/gcc?
  2008-11-01 17:49     ` David Arnstein
@ 2008-11-01 20:10       ` Brian Dessent
  2008-11-03  9:08         ` Corinna Vinschen
  0 siblings, 1 reply; 6+ messages in thread
From: Brian Dessent @ 2008-11-01 20:10 UTC (permalink / raw)
  To: cygwin

David Arnstein wrote:

>         #include <w32api/ddk/ntapi.h>

You don't need the w32api prefix, that is part of the built-in search
path -- otherwise, #include <windows.h> would not work.

You also need to link with -lntdll.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Call "undocumented" NTDLL functions with Cygwin/gcc?
  2008-11-01 20:10       ` Brian Dessent
@ 2008-11-03  9:08         ` Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2008-11-03  9:08 UTC (permalink / raw)
  To: cygwin

On Nov  1 13:09, Brian Dessent wrote:
> David Arnstein wrote:
> 
> >         #include <w32api/ddk/ntapi.h>
> 
> You don't need the w32api prefix

Additionally, since you're building a MingW application (-mno-cygwin),
/usr/include is *not* in the search path for, hopefully, obvious reasons.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-03  9:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-01  7:50 Call "undocumented" NTDLL functions with Cygwin/gcc? David Arnstein
2008-11-01  9:14 ` Corinna Vinschen
2008-11-01 14:15   ` Christopher Faylor
2008-11-01 17:49     ` David Arnstein
2008-11-01 20:10       ` Brian Dessent
2008-11-03  9:08         ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).