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