]> sourceware.org Git - newlib-cygwin.git/commitdiff
* autoload.cc (LoadDLLfuncNt): New define to wrap NT native functions.
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 13 Mar 2006 11:22:51 +0000 (11:22 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 13 Mar 2006 11:22:51 +0000 (11:22 +0000)
Use for NT native functions throughout.
* dtable.cc (handle_to_fn): Treate return value of NtQueryObject as
NTSTATUS value.

winsup/cygwin/ChangeLog
winsup/cygwin/autoload.cc
winsup/cygwin/dtable.cc

index eec1915b9ed6abcc884c88db7a3d88b92813c1e0..f84b3d9e87f3a36e80cedfa5caae15dd9c2225c5 100644 (file)
@@ -1,3 +1,10 @@
+2006-03-13  Corinna Vinschen  <corinna@vinschen.de>
+
+       * autoload.cc (LoadDLLfuncNt): New define to wrap NT native functions.
+       Use for NT native functions throughout.
+       * dtable.cc (handle_to_fn): Treate return value of NtQueryObject as
+       NTSTATUS value.
+
 2006-03-12  Christopher Faylor  <cgf@timesys.com>
 
        * cygtls.cc (_cygtls::remove): Reset initialized flag right away if we
index 6b889a946f76e5230fbcc346f2e6a63bb7b15468..c6ce11317c6d1cd55f48af938c8e5cfbb89183b5 100644 (file)
@@ -378,30 +378,33 @@ LoadDLLfunc (NetUserGetGroups, 28, netapi32)
 LoadDLLfunc (NetUserGetInfo, 16, netapi32)
 LoadDLLfunc (NetWkstaUserGetInfo, 12, netapi32)
 
-LoadDLLfuncEx (NtClose, 4, ntdll, 1)
-LoadDLLfuncEx (NtCreateFile, 44, ntdll, 1)
-LoadDLLfuncEx (NtCreateSection, 28, ntdll, 1)
-LoadDLLfuncEx (NtCreateToken, 52, ntdll, 1)
-LoadDLLfuncEx (NtLockVirtualMemory, 16, ntdll, 1)
-LoadDLLfuncEx (NtMapViewOfSection, 40, ntdll, 1)
-LoadDLLfuncEx (NtOpenDirectoryObject, 12, ntdll, 1)
-LoadDLLfuncEx (NtOpenFile, 24, ntdll, 1)
-LoadDLLfuncEx (NtOpenSection, 12, ntdll, 1)
-LoadDLLfuncEx (NtQueryDirectoryObject, 28, ntdll, 1)
-LoadDLLfuncEx2 (NtQueryDirectoryFile, 44, ntdll, 1, 1)
-LoadDLLfuncEx2 (NtQueryInformationFile, 20, ntdll, 1, 1)
-LoadDLLfuncEx (NtQueryInformationProcess, 20, ntdll, 1)
-LoadDLLfuncEx2 (NtQueryObject, 20, ntdll, 1, 1)
-LoadDLLfuncEx (NtQuerySystemInformation, 16, ntdll, 1)
-LoadDLLfuncEx (NtQuerySecurityObject, 20, ntdll, 1)
-LoadDLLfuncEx (NtQueryVirtualMemory, 24, ntdll, 1)
-LoadDLLfuncEx (NtQueryVolumeInformationFile, 20, ntdll, 1)
-LoadDLLfuncEx (NtSetSecurityObject, 12, ntdll, 1)
-LoadDLLfuncEx (NtUnlockVirtualMemory, 16, ntdll, 1)
-LoadDLLfuncEx (NtUnmapViewOfSection, 8, ntdll, 1)
-LoadDLLfuncEx (RtlInitUnicodeString, 8, ntdll, 1)
-LoadDLLfuncEx (RtlNtStatusToDosError, 4, ntdll, 1)
-LoadDLLfuncEx (RtlIsDosDeviceName_U, 4, ntdll, 1)
+/* 0xc000007a == STATUS_PROCEDURE_NOT_FOUND */
+#define LoadDLLfuncNt(name, n, dllname) \
+  LoadDLLfuncEx2(name, n, dllname, 1, 0xc000007a)
+LoadDLLfuncNt (NtClose, 4, ntdll)
+LoadDLLfuncNt (NtCreateFile, 44, ntdll)
+LoadDLLfuncNt (NtCreateSection, 28, ntdll)
+LoadDLLfuncNt (NtCreateToken, 52, ntdll)
+LoadDLLfuncNt (NtLockVirtualMemory, 16, ntdll)
+LoadDLLfuncNt (NtMapViewOfSection, 40, ntdll)
+LoadDLLfuncNt (NtOpenDirectoryObject, 12, ntdll)
+LoadDLLfuncNt (NtOpenFile, 24, ntdll)
+LoadDLLfuncNt (NtOpenSection, 12, ntdll)
+LoadDLLfuncNt (NtQueryDirectoryObject, 28, ntdll)
+LoadDLLfuncNt (NtQueryDirectoryFile, 44, ntdll)
+LoadDLLfuncNt (NtQueryInformationFile, 20, ntdll)
+LoadDLLfuncNt (NtQueryInformationProcess, 20, ntdll)
+LoadDLLfuncNt (NtQueryObject, 20, ntdll)
+LoadDLLfuncNt (NtQuerySystemInformation, 16, ntdll)
+LoadDLLfuncNt (NtQuerySecurityObject, 20, ntdll)
+LoadDLLfuncNt (NtQueryVirtualMemory, 24, ntdll)
+LoadDLLfuncNt (NtQueryVolumeInformationFile, 20, ntdll)
+LoadDLLfuncNt (NtSetSecurityObject, 12, ntdll)
+LoadDLLfuncNt (NtUnlockVirtualMemory, 16, ntdll)
+LoadDLLfuncNt (NtUnmapViewOfSection, 8, ntdll)
+LoadDLLfuncNt (RtlInitUnicodeString, 8, ntdll)
+LoadDLLfuncNt (RtlIsDosDeviceName_U, 4, ntdll)
+LoadDLLfuncNt (RtlNtStatusToDosError, 4, ntdll)
 
 LoadDLLfuncEx (EnumProcessModules, 16, psapi, 1)
 LoadDLLfuncEx (GetModuleFileNameExA, 16, psapi, 1)
index c4a8333d56c8ac5a1d49a2c8e4926cbce7caddb4..8996e8587d233fb1d0404a59c74ba4a17763d622 100644 (file)
@@ -829,9 +829,10 @@ handle_to_fn (HANDLE h, char *posix_fn)
   ntfn->Name.MaximumLength = sizeof (fnbuf) - sizeof (*ntfn);
   ntfn->Name.Buffer = (WCHAR *) (ntfn + 1);
 
-  DWORD res = NtQueryObject (h, ObjectNameInformation, ntfn, sizeof (fnbuf), NULL);
+  NTSTATUS res = NtQueryObject (h, ObjectNameInformation, ntfn, sizeof (fnbuf),
+                               NULL);
 
-  if (res)
+  if (NT_SUCCESS (res))
     {
       strcpy (posix_fn, unknown_file);
       debug_printf ("NtQueryObject failed");
This page took 0.037854 seconds and 5 git commands to generate.