| 1 | /* $Id: om.cpp,v 1.2 1999-06-10 17:06:46 phaller Exp $ */ | 
|---|
| 2 |  | 
|---|
| 3 | /* | 
|---|
| 4 | * Project Odin Software License can be found in LICENSE.TXT | 
|---|
| 5 | * Win32 NT Runtime / NTDLL for OS/2 | 
|---|
| 6 | * | 
|---|
| 7 | * Copyright 1998       original WINE Author | 
|---|
| 8 | * Copyright 1998, 1999 Patrick Haller (phaller@gmx.net) | 
|---|
| 9 | * | 
|---|
| 10 | * Object management functions | 
|---|
| 11 | */ | 
|---|
| 12 |  | 
|---|
| 13 | #include <stdlib.h> | 
|---|
| 14 | #include <string.h> | 
|---|
| 15 |  | 
|---|
| 16 | #include "ntdll.h" | 
|---|
| 17 |  | 
|---|
| 18 | /* move to somewhere */ | 
|---|
| 19 | typedef void * POBJDIR_INFORMATION; | 
|---|
| 20 |  | 
|---|
| 21 | /* | 
|---|
| 22 | * Generic object functions | 
|---|
| 23 | */ | 
|---|
| 24 |  | 
|---|
| 25 | /****************************************************************************** | 
|---|
| 26 | * NtQueryObject [NTDLL.161] | 
|---|
| 27 | */ | 
|---|
| 28 | NTSTATUS WINAPI NtQueryObject(HANDLE                   ObjectHandle, | 
|---|
| 29 | OBJECT_INFORMATION_CLASS ObjectInformationClass, | 
|---|
| 30 | PVOID                    ObjectInformation, | 
|---|
| 31 | ULONG                    Length, | 
|---|
| 32 | PULONG                   ResultLength) | 
|---|
| 33 | { | 
|---|
| 34 | dprintf(("NTDLL: NtQueryObject(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n", | 
|---|
| 35 | ObjectHandle, | 
|---|
| 36 | ObjectInformationClass, | 
|---|
| 37 | ObjectInformation, | 
|---|
| 38 | Length, | 
|---|
| 39 | ResultLength)); | 
|---|
| 40 |  | 
|---|
| 41 | return 0; | 
|---|
| 42 | } | 
|---|
| 43 |  | 
|---|
| 44 |  | 
|---|
| 45 | /****************************************************************************** | 
|---|
| 46 | *  NtQuerySecurityObject                [NTDLL] | 
|---|
| 47 | */ | 
|---|
| 48 | NTSTATUS WINAPI NtQuerySecurityObject(DWORD x1, | 
|---|
| 49 | DWORD x2, | 
|---|
| 50 | DWORD x3, | 
|---|
| 51 | DWORD x4, | 
|---|
| 52 | DWORD x5) | 
|---|
| 53 | { | 
|---|
| 54 | dprintf(("NTDLL: NtQuerySecurityObject(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n", | 
|---|
| 55 | x1, | 
|---|
| 56 | x2, | 
|---|
| 57 | x3, | 
|---|
| 58 | x4, | 
|---|
| 59 | x5)); | 
|---|
| 60 |  | 
|---|
| 61 | return 0; | 
|---|
| 62 | } | 
|---|
| 63 |  | 
|---|
| 64 |  | 
|---|
| 65 | /****************************************************************************** | 
|---|
| 66 | *  NtDuplicateObject                       [NTDLL] | 
|---|
| 67 | */ | 
|---|
| 68 | NTSTATUS WINAPI NtDuplicateObject(HANDLE      SourceProcessHandle, | 
|---|
| 69 | PHANDLE     SourceHandle, | 
|---|
| 70 | HANDLE      TargetProcessHandle, | 
|---|
| 71 | PHANDLE     TargetHandle, | 
|---|
| 72 | ACCESS_MASK DesiredAccess, | 
|---|
| 73 | BOOLEAN     InheritHandle, | 
|---|
| 74 | ULONG       Options) | 
|---|
| 75 | { | 
|---|
| 76 | dprintf (("NTDLL: NtDuplicateObject(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n", | 
|---|
| 77 | SourceProcessHandle, | 
|---|
| 78 | SourceHandle, | 
|---|
| 79 | TargetProcessHandle, | 
|---|
| 80 | TargetHandle, | 
|---|
| 81 | DesiredAccess, | 
|---|
| 82 | InheritHandle, | 
|---|
| 83 | Options)); | 
|---|
| 84 |  | 
|---|
| 85 | *TargetHandle = 0; | 
|---|
| 86 | return 0; | 
|---|
| 87 | } | 
|---|
| 88 |  | 
|---|
| 89 |  | 
|---|
| 90 | /************************************************************************** | 
|---|
| 91 | *                 NtClose                        [NTDLL.65] | 
|---|
| 92 | * FUNCTION: Closes a handle reference to an object | 
|---|
| 93 | * ARGUMENTS: | 
|---|
| 94 | * Handle   handle to close | 
|---|
| 95 | */ | 
|---|
| 96 | //NTSTATUS WINAPI NtClose( | 
|---|
| 97 | //   HANDLE Handle) | 
|---|
| 98 | //{ | 
|---|
| 99 | //   FIXME(ntdll,"(0x%08x),stub!\n",Handle); | 
|---|
| 100 | //   return 1; | 
|---|
| 101 | //} | 
|---|
| 102 |  | 
|---|
| 103 |  | 
|---|
| 104 | /****************************************************************************** | 
|---|
| 105 | *  NtWaitForSingleObject                   [NTDLL] | 
|---|
| 106 | */ | 
|---|
| 107 | NTSTATUS WINAPI NtWaitForSingleObject(PHANDLE        Object, | 
|---|
| 108 | BOOLEAN        Alertable, | 
|---|
| 109 | PLARGE_INTEGER Time) | 
|---|
| 110 | { | 
|---|
| 111 | dprintf(("NTDLL: NtWaitForSingleObject(%08xh,%08xh,%08xh) not implemented.\n", | 
|---|
| 112 | Object, | 
|---|
| 113 | Alertable, | 
|---|
| 114 | Time)); | 
|---|
| 115 |  | 
|---|
| 116 | return 0; | 
|---|
| 117 | } | 
|---|
| 118 |  | 
|---|
| 119 |  | 
|---|
| 120 | /* | 
|---|
| 121 | * Directory functions | 
|---|
| 122 | */ | 
|---|
| 123 |  | 
|---|
| 124 | /************************************************************************** | 
|---|
| 125 | * NtOpenDirectoryObject [NTDLL.124] | 
|---|
| 126 | * FUNCTION: Opens a namespace directory object | 
|---|
| 127 | * ARGUMENTS: | 
|---|
| 128 | *  DirectoryHandle                      Variable which receives the directory handle | 
|---|
| 129 | *  DesiredAccess Desired access to the directory | 
|---|
| 130 | *  ObjectAttributes                     Structure describing the directory | 
|---|
| 131 | * RETURNS: Status | 
|---|
| 132 | */ | 
|---|
| 133 | NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE            DirectoryHandle, | 
|---|
| 134 | ACCESS_MASK        DesiredAccess, | 
|---|
| 135 | POBJECT_ATTRIBUTES ObjectAttributes) | 
|---|
| 136 | { | 
|---|
| 137 | dprintf(("NTDLL: NtOpenDirectoryObject(%08xh,%08xh,%08xh) not implemented.\n", | 
|---|
| 138 | DirectoryHandle, | 
|---|
| 139 | DesiredAccess, | 
|---|
| 140 | ObjectAttributes)); | 
|---|
| 141 |  | 
|---|
| 142 | return 0; | 
|---|
| 143 | } | 
|---|
| 144 |  | 
|---|
| 145 |  | 
|---|
| 146 | /****************************************************************************** | 
|---|
| 147 | *  NtCreateDirectoryObject              [NTDLL] | 
|---|
| 148 | */ | 
|---|
| 149 | NTSTATUS WINAPI NtCreateDirectoryObject(PHANDLE            DirectoryHandle, | 
|---|
| 150 | ACCESS_MASK        DesiredAccess, | 
|---|
| 151 | POBJECT_ATTRIBUTES ObjectAttributes) | 
|---|
| 152 | { | 
|---|
| 153 | dprintf(("NTDLL: NtCreateDirectoryObject(%08xh,%08xh,%08xh) not implemented.\n", | 
|---|
| 154 | DirectoryHandle, | 
|---|
| 155 | DesiredAccess, | 
|---|
| 156 | ObjectAttributes)); | 
|---|
| 157 |  | 
|---|
| 158 | return 0; | 
|---|
| 159 | } | 
|---|
| 160 |  | 
|---|
| 161 |  | 
|---|
| 162 | /****************************************************************************** | 
|---|
| 163 | * NtQueryDirectoryObject [NTDLL.149] | 
|---|
| 164 | * FUNCTION: Reads information from a namespace directory | 
|---|
| 165 | * ARGUMENTS: | 
|---|
| 166 | *  DirObjInformation                    Buffer to hold the data read | 
|---|
| 167 | *  BufferLength  Size of the buffer in bytes | 
|---|
| 168 | *  GetNextIndex  If TRUE then set ObjectIndex to the index of the next object | 
|---|
| 169 | *       If FALSE then set ObjectIndex to the number of objects in the directory | 
|---|
| 170 | *  IgnoreInputIndex                     If TRUE start reading at index 0 | 
|---|
| 171 | *       If FALSE start reading at the index specified by object index | 
|---|
| 172 | *  ObjectIndex                          Zero based index into the directory, interpretation depends on IgnoreInputIndex and GetNextIndex | 
|---|
| 173 | *  DataWritten                          Caller supplied storage for the number of bytes written (or NULL) | 
|---|
| 174 | */ | 
|---|
| 175 | NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE              DirObjHandle, | 
|---|
| 176 | POBJDIR_INFORMATION DirObjInformation, | 
|---|
| 177 | ULONG               BufferLength, | 
|---|
| 178 | BOOLEAN             GetNextIndex, | 
|---|
| 179 | BOOLEAN             IgnoreInputIndex, | 
|---|
| 180 | PULONG              ObjectIndex, | 
|---|
| 181 | PULONG              DataWritten) | 
|---|
| 182 | { | 
|---|
| 183 | dprintf(("NTDLL: NtQueryDirectoryObject(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n", | 
|---|
| 184 | DirObjHandle, | 
|---|
| 185 | DirObjInformation, | 
|---|
| 186 | BufferLength, | 
|---|
| 187 | GetNextIndex, | 
|---|
| 188 | IgnoreInputIndex, | 
|---|
| 189 | ObjectIndex, | 
|---|
| 190 | DataWritten)); | 
|---|
| 191 |  | 
|---|
| 192 | return 0xc0000000; /* We don't have any. Whatever. (Yet.) */ | 
|---|
| 193 | } | 
|---|
| 194 |  | 
|---|
| 195 |  | 
|---|
| 196 | /* | 
|---|
| 197 | * Link objects | 
|---|
| 198 | */ | 
|---|
| 199 |  | 
|---|
| 200 | /****************************************************************************** | 
|---|
| 201 | *  NtOpenSymbolicLinkObject             [NTDLL] | 
|---|
| 202 | */ | 
|---|
| 203 | NTSTATUS WINAPI NtOpenSymbolicLinkObject(PHANDLE            LinkHandle, | 
|---|
| 204 | ACCESS_MASK        DesiredAccess, | 
|---|
| 205 | POBJECT_ATTRIBUTES ObjectAttributes) | 
|---|
| 206 | { | 
|---|
| 207 | dprintf(("NTDLL: NtOpenSymbolicLinkObject(%08xh,%08xh,%08xh) not implemented.\n", | 
|---|
| 208 | LinkHandle, | 
|---|
| 209 | DesiredAccess, | 
|---|
| 210 | ObjectAttributes)); | 
|---|
| 211 |  | 
|---|
| 212 | return 0; | 
|---|
| 213 | } | 
|---|
| 214 |  | 
|---|
| 215 |  | 
|---|
| 216 | /****************************************************************************** | 
|---|
| 217 | *  NtCreateSymbolicLinkObject           [NTDLL] | 
|---|
| 218 | */ | 
|---|
| 219 | NTSTATUS WINAPI NtCreateSymbolicLinkObject(PHANDLE            SymbolicLinkHandle, | 
|---|
| 220 | ACCESS_MASK        DesiredAccess, | 
|---|
| 221 | POBJECT_ATTRIBUTES ObjectAttributes, | 
|---|
| 222 | PUNICODE_STRING    Name) | 
|---|
| 223 | { | 
|---|
| 224 | dprintf(("NTDLL: NtCreateSymbolicLinkObject(%08xh,%08xh,%08xh,%08x) not implemented.\n", | 
|---|
| 225 | SymbolicLinkHandle, | 
|---|
| 226 | DesiredAccess, | 
|---|
| 227 | ObjectAttributes, | 
|---|
| 228 | Name)); | 
|---|
| 229 |  | 
|---|
| 230 | return 0; | 
|---|
| 231 | } | 
|---|
| 232 |  | 
|---|
| 233 |  | 
|---|
| 234 | /****************************************************************************** | 
|---|
| 235 | *  NtQuerySymbolicLinkObject            [NTDLL] | 
|---|
| 236 | */ | 
|---|
| 237 | NTSTATUS WINAPI NtQuerySymbolicLinkObject(HANDLE          LinkHandle, | 
|---|
| 238 | PUNICODE_STRING LinkTarget, | 
|---|
| 239 | PULONG          ReturnedLength) | 
|---|
| 240 | { | 
|---|
| 241 | dprintf(("NTDLL: NtQuerySymbolicLinkObject(%08xh,%08xh,%08xh) not implemented.\n", | 
|---|
| 242 | LinkHandle, | 
|---|
| 243 | LinkTarget, | 
|---|
| 244 | ReturnedLength)); | 
|---|
| 245 |  | 
|---|
| 246 | return 0; | 
|---|
| 247 | } | 
|---|
| 248 |  | 
|---|