2 * Object management functions
4 * Copyright 1999, 2000 Juergen Schmied
5 * Copyright 2005 Vitaliy Margolen
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
35 #define WIN32_NO_STATUS
36 #include "wine/debug.h"
39 #include "ntdll_misc.h"
40 #include "wine/server.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(ntdll
);
46 * Generic object functions
49 /******************************************************************************
50 * NtQueryObject [NTDLL.@]
51 * ZwQueryObject [NTDLL.@]
53 NTSTATUS WINAPI
NtQueryObject(IN HANDLE handle
,
54 IN OBJECT_INFORMATION_CLASS info_class
,
55 OUT PVOID ptr
, IN ULONG len
, OUT PULONG used_len
)
59 TRACE("(%p,0x%08x,%p,0x%08x,%p)\n", handle
, info_class
, ptr
, len
, used_len
);
61 if (used_len
) *used_len
= 0;
65 case ObjectBasicInformation
:
67 POBJECT_BASIC_INFORMATION p
= ptr
;
69 if (len
< sizeof(*p
)) return STATUS_INVALID_BUFFER_SIZE
;
71 SERVER_START_REQ( get_object_info
)
73 req
->handle
= wine_server_obj_handle( handle
);
74 status
= wine_server_call( req
);
75 if (status
== STATUS_SUCCESS
)
77 memset( p
, 0, sizeof(*p
) );
78 p
->GrantedAccess
= reply
->access
;
79 p
->PointerCount
= reply
->ref_count
;
80 p
->HandleCount
= reply
->handle_count
;
81 if (used_len
) *used_len
= sizeof(*p
);
87 case ObjectNameInformation
:
89 OBJECT_NAME_INFORMATION
* p
= ptr
;
90 ANSI_STRING unix_name
;
92 /* first try as a file object */
94 if (!(status
= server_get_unix_name( handle
, &unix_name
)))
96 UNICODE_STRING nt_name
;
98 if (!(status
= wine_unix_to_nt_file_name( &unix_name
, &nt_name
)))
100 if (len
< sizeof(*p
))
101 status
= STATUS_INFO_LENGTH_MISMATCH
;
102 else if (len
< sizeof(*p
) + nt_name
.MaximumLength
)
103 status
= STATUS_BUFFER_OVERFLOW
;
106 p
->Name
.Buffer
= (WCHAR
*)(p
+ 1);
107 p
->Name
.Length
= nt_name
.Length
;
108 p
->Name
.MaximumLength
= nt_name
.MaximumLength
;
109 memcpy( p
->Name
.Buffer
, nt_name
.Buffer
, nt_name
.MaximumLength
);
111 if (used_len
) *used_len
= sizeof(*p
) + nt_name
.MaximumLength
;
112 RtlFreeUnicodeString( &nt_name
);
114 RtlFreeAnsiString( &unix_name
);
117 else if (status
!= STATUS_OBJECT_TYPE_MISMATCH
) break;
119 /* not a file, treat as a generic object */
121 SERVER_START_REQ( get_object_info
)
123 req
->handle
= wine_server_obj_handle( handle
);
124 if (len
> sizeof(*p
)) wine_server_set_reply( req
, p
+ 1, len
- sizeof(*p
) );
125 status
= wine_server_call( req
);
126 if (status
== STATUS_SUCCESS
)
128 if (!reply
->total
) /* no name */
130 if (sizeof(*p
) > len
) status
= STATUS_INFO_LENGTH_MISMATCH
;
131 else memset( p
, 0, sizeof(*p
) );
132 if (used_len
) *used_len
= sizeof(*p
);
134 else if (sizeof(*p
) + reply
->total
+ sizeof(WCHAR
) > len
)
136 if (used_len
) *used_len
= sizeof(*p
) + reply
->total
+ sizeof(WCHAR
);
137 status
= STATUS_INFO_LENGTH_MISMATCH
;
141 ULONG res
= wine_server_reply_size( reply
);
142 p
->Name
.Buffer
= (WCHAR
*)(p
+ 1);
143 p
->Name
.Length
= res
;
144 p
->Name
.MaximumLength
= res
+ sizeof(WCHAR
);
145 p
->Name
.Buffer
[res
/ sizeof(WCHAR
)] = 0;
146 if (used_len
) *used_len
= sizeof(*p
) + p
->Name
.MaximumLength
;
153 case ObjectTypeInformation
:
155 OBJECT_TYPE_INFORMATION
*p
= ptr
;
157 SERVER_START_REQ( get_object_type
)
159 req
->handle
= wine_server_obj_handle( handle
);
160 if (len
> sizeof(*p
)) wine_server_set_reply( req
, p
+ 1, len
- sizeof(*p
) );
161 status
= wine_server_call( req
);
162 if (status
== STATUS_SUCCESS
)
164 if (!reply
->total
) /* no name */
166 if (sizeof(*p
) > len
) status
= STATUS_INFO_LENGTH_MISMATCH
;
167 else memset( p
, 0, sizeof(*p
) );
168 if (used_len
) *used_len
= sizeof(*p
);
170 else if (sizeof(*p
) + reply
->total
+ sizeof(WCHAR
) > len
)
172 if (used_len
) *used_len
= sizeof(*p
) + reply
->total
+ sizeof(WCHAR
);
173 status
= STATUS_INFO_LENGTH_MISMATCH
;
177 ULONG res
= wine_server_reply_size( reply
);
178 p
->TypeName
.Buffer
= (WCHAR
*)(p
+ 1);
179 p
->TypeName
.Length
= res
;
180 p
->TypeName
.MaximumLength
= res
+ sizeof(WCHAR
);
181 p
->TypeName
.Buffer
[res
/ sizeof(WCHAR
)] = 0;
182 if (used_len
) *used_len
= sizeof(*p
) + p
->TypeName
.MaximumLength
;
189 case ObjectDataInformation
:
191 OBJECT_DATA_INFORMATION
* p
= ptr
;
193 if (len
< sizeof(*p
)) return STATUS_INVALID_BUFFER_SIZE
;
195 SERVER_START_REQ( set_handle_info
)
197 req
->handle
= wine_server_obj_handle( handle
);
200 status
= wine_server_call( req
);
201 if (status
== STATUS_SUCCESS
)
203 p
->InheritHandle
= (reply
->old_flags
& HANDLE_FLAG_INHERIT
) != 0;
204 p
->ProtectFromClose
= (reply
->old_flags
& HANDLE_FLAG_PROTECT_FROM_CLOSE
) != 0;
205 if (used_len
) *used_len
= sizeof(*p
);
212 FIXME("Unsupported information class %u\n", info_class
);
213 status
= STATUS_NOT_IMPLEMENTED
;
219 /******************************************************************
220 * NtSetInformationObject [NTDLL.@]
221 * ZwSetInformationObject [NTDLL.@]
224 NTSTATUS WINAPI
NtSetInformationObject(IN HANDLE handle
,
225 IN OBJECT_INFORMATION_CLASS info_class
,
226 IN PVOID ptr
, IN ULONG len
)
230 TRACE("(%p,0x%08x,%p,0x%08x)\n", handle
, info_class
, ptr
, len
);
234 case ObjectDataInformation
:
236 OBJECT_DATA_INFORMATION
* p
= ptr
;
238 if (len
< sizeof(*p
)) return STATUS_INVALID_BUFFER_SIZE
;
240 SERVER_START_REQ( set_handle_info
)
242 req
->handle
= wine_server_obj_handle( handle
);
244 req
->mask
= HANDLE_FLAG_INHERIT
| HANDLE_FLAG_PROTECT_FROM_CLOSE
;
245 if (p
->InheritHandle
) req
->flags
|= HANDLE_FLAG_INHERIT
;
246 if (p
->ProtectFromClose
) req
->flags
|= HANDLE_FLAG_PROTECT_FROM_CLOSE
;
247 status
= wine_server_call( req
);
253 FIXME("Unsupported information class %u\n", info_class
);
254 status
= STATUS_NOT_IMPLEMENTED
;
260 /******************************************************************************
261 * NtQuerySecurityObject [NTDLL.@]
263 * An ntdll analogue to GetKernelObjectSecurity().
267 NtQuerySecurityObject(
269 IN SECURITY_INFORMATION RequestedInformation
,
270 OUT PSECURITY_DESCRIPTOR pSecurityDescriptor
,
272 OUT PULONG ResultLength
)
274 PISECURITY_DESCRIPTOR_RELATIVE psd
= pSecurityDescriptor
;
276 unsigned int buffer_size
= 512;
277 BOOLEAN need_more_memory
;
279 TRACE("(%p,0x%08x,%p,0x%08x,%p)\n",
280 Object
, RequestedInformation
, pSecurityDescriptor
, Length
, ResultLength
);
284 char *buffer
= RtlAllocateHeap(GetProcessHeap(), 0, buffer_size
);
286 return STATUS_NO_MEMORY
;
288 need_more_memory
= FALSE
;
290 SERVER_START_REQ( get_security_object
)
292 req
->handle
= wine_server_obj_handle( Object
);
293 req
->security_info
= RequestedInformation
;
294 wine_server_set_reply( req
, buffer
, buffer_size
);
295 status
= wine_server_call( req
);
296 if (status
== STATUS_SUCCESS
)
298 struct security_descriptor
*sd
= (struct security_descriptor
*)buffer
;
301 *ResultLength
= sizeof(SECURITY_DESCRIPTOR_RELATIVE
) +
302 sd
->owner_len
+ sd
->group_len
+ sd
->sacl_len
+ sd
->dacl_len
;
303 if (Length
>= *ResultLength
)
305 psd
->Revision
= SECURITY_DESCRIPTOR_REVISION
;
307 psd
->Control
= sd
->control
| SE_SELF_RELATIVE
;
308 psd
->Owner
= sd
->owner_len
? sizeof(SECURITY_DESCRIPTOR_RELATIVE
) : 0;
309 psd
->Group
= sd
->group_len
? sizeof(SECURITY_DESCRIPTOR_RELATIVE
) + sd
->owner_len
: 0;
310 psd
->Sacl
= sd
->sacl_len
? sizeof(SECURITY_DESCRIPTOR_RELATIVE
) + sd
->owner_len
+ sd
->group_len
: 0;
311 psd
->Dacl
= sd
->dacl_len
? sizeof(SECURITY_DESCRIPTOR_RELATIVE
) + sd
->owner_len
+ sd
->group_len
+ sd
->sacl_len
: 0;
312 /* owner, group, sacl and dacl are the same type as in the server
313 * and in the same order so we copy the memory in one block */
314 memcpy((char *)pSecurityDescriptor
+ sizeof(SECURITY_DESCRIPTOR_RELATIVE
),
315 buffer
+ sizeof(struct security_descriptor
),
316 sd
->owner_len
+ sd
->group_len
+ sd
->sacl_len
+ sd
->dacl_len
);
319 status
= STATUS_BUFFER_TOO_SMALL
;
323 *ResultLength
= sizeof(SECURITY_DESCRIPTOR_RELATIVE
);
324 if (Length
>= *ResultLength
)
326 memset(psd
, 0, sizeof(*psd
));
327 psd
->Revision
= SECURITY_DESCRIPTOR_REVISION
;
328 psd
->Control
= SE_SELF_RELATIVE
;
331 status
= STATUS_BUFFER_TOO_SMALL
;
334 else if (status
== STATUS_BUFFER_TOO_SMALL
)
336 buffer_size
= reply
->sd_len
;
337 need_more_memory
= TRUE
;
341 RtlFreeHeap(GetProcessHeap(), 0, buffer
);
342 } while (need_more_memory
);
348 /******************************************************************************
349 * NtDuplicateObject [NTDLL.@]
350 * ZwDuplicateObject [NTDLL.@]
352 NTSTATUS WINAPI
NtDuplicateObject( HANDLE source_process
, HANDLE source
,
353 HANDLE dest_process
, PHANDLE dest
,
354 ACCESS_MASK access
, ULONG attributes
, ULONG options
)
357 SERVER_START_REQ( dup_handle
)
359 req
->src_process
= wine_server_obj_handle( source_process
);
360 req
->src_handle
= wine_server_obj_handle( source
);
361 req
->dst_process
= wine_server_obj_handle( dest_process
);
362 req
->access
= access
;
363 req
->attributes
= attributes
;
364 req
->options
= options
;
366 if (!(ret
= wine_server_call( req
)))
368 if (dest
) *dest
= wine_server_ptr_handle( reply
->handle
);
369 if (reply
->closed
&& reply
->self
)
371 int fd
= server_remove_fd_from_cache( source
);
372 if (fd
!= -1) close( fd
);
380 /* Everquest 2 / Pirates of the Burning Sea hooks NtClose, so we need a wrapper */
381 NTSTATUS
close_handle( HANDLE handle
)
384 int fd
= server_remove_fd_from_cache( handle
);
386 SERVER_START_REQ( close_handle
)
388 req
->handle
= wine_server_obj_handle( handle
);
389 ret
= wine_server_call( req
);
392 if (fd
!= -1) close( fd
);
396 /**************************************************************************
399 * Close a handle reference to an object.
402 * Handle [I] handle to close
405 * Success: ERROR_SUCCESS.
406 * Failure: An NTSTATUS error code.
408 NTSTATUS WINAPI
NtClose( HANDLE Handle
)
410 return close_handle( Handle
);
414 * Directory functions
417 /**************************************************************************
418 * NtOpenDirectoryObject [NTDLL.@]
419 * ZwOpenDirectoryObject [NTDLL.@]
421 * Open a namespace directory object.
424 * DirectoryHandle [O] Destination for the new directory handle
425 * DesiredAccess [I] Desired access to the directory
426 * ObjectAttributes [I] Structure describing the directory
429 * Success: ERROR_SUCCESS.
430 * Failure: An NTSTATUS error code.
432 NTSTATUS WINAPI
NtOpenDirectoryObject(PHANDLE DirectoryHandle
, ACCESS_MASK DesiredAccess
,
433 POBJECT_ATTRIBUTES ObjectAttributes
)
437 if (!DirectoryHandle
) return STATUS_ACCESS_VIOLATION
;
438 if (!ObjectAttributes
) return STATUS_INVALID_PARAMETER
;
439 TRACE("(%p,0x%08x,%s)\n", DirectoryHandle
, DesiredAccess
, debugstr_ObjectAttributes(ObjectAttributes
));
440 /* Have to test it here because server won't know difference between
441 * ObjectName == NULL and ObjectName == "" */
442 if (!ObjectAttributes
->ObjectName
)
444 if (ObjectAttributes
->RootDirectory
)
445 return STATUS_OBJECT_NAME_INVALID
;
447 return STATUS_OBJECT_PATH_SYNTAX_BAD
;
450 SERVER_START_REQ(open_directory
)
452 req
->access
= DesiredAccess
;
453 req
->attributes
= ObjectAttributes
->Attributes
;
454 req
->rootdir
= wine_server_obj_handle( ObjectAttributes
->RootDirectory
);
455 if (ObjectAttributes
->ObjectName
)
456 wine_server_add_data(req
, ObjectAttributes
->ObjectName
->Buffer
,
457 ObjectAttributes
->ObjectName
->Length
);
458 ret
= wine_server_call( req
);
459 *DirectoryHandle
= wine_server_ptr_handle( reply
->handle
);
465 /******************************************************************************
466 * NtCreateDirectoryObject [NTDLL.@]
467 * ZwCreateDirectoryObject [NTDLL.@]
469 * Create a namespace directory object.
472 * DirectoryHandle [O] Destination for the new directory handle
473 * DesiredAccess [I] Desired access to the directory
474 * ObjectAttributes [I] Structure describing the directory
477 * Success: ERROR_SUCCESS.
478 * Failure: An NTSTATUS error code.
480 NTSTATUS WINAPI
NtCreateDirectoryObject(PHANDLE DirectoryHandle
, ACCESS_MASK DesiredAccess
,
481 POBJECT_ATTRIBUTES ObjectAttributes
)
485 if (!DirectoryHandle
) return STATUS_ACCESS_VIOLATION
;
486 TRACE("(%p,0x%08x,%s)\n", DirectoryHandle
, DesiredAccess
, debugstr_ObjectAttributes(ObjectAttributes
));
488 SERVER_START_REQ(create_directory
)
490 req
->access
= DesiredAccess
;
491 req
->attributes
= ObjectAttributes
? ObjectAttributes
->Attributes
: 0;
492 req
->rootdir
= wine_server_obj_handle( ObjectAttributes
? ObjectAttributes
->RootDirectory
: 0 );
493 if (ObjectAttributes
&& ObjectAttributes
->ObjectName
)
494 wine_server_add_data(req
, ObjectAttributes
->ObjectName
->Buffer
,
495 ObjectAttributes
->ObjectName
->Length
);
496 ret
= wine_server_call( req
);
497 *DirectoryHandle
= wine_server_ptr_handle( reply
->handle
);
503 /******************************************************************************
504 * NtQueryDirectoryObject [NTDLL.@]
505 * ZwQueryDirectoryObject [NTDLL.@]
507 * Read information from a namespace directory.
510 * handle [I] Handle to a directory object
511 * buffer [O] Buffer to hold the read data
512 * size [I] Size of the buffer in bytes
513 * single_entry [I] If TRUE, return a single entry, if FALSE, return as many as fit in the buffer
514 * restart [I] If TRUE, start scanning from the start, if FALSE, scan from Context
515 * context [I/O] Indicates what point of the directory the scan is at
516 * ret_size [O] Caller supplied storage for the number of bytes written (or NULL)
519 * Success: ERROR_SUCCESS.
520 * Failure: An NTSTATUS error code.
522 NTSTATUS WINAPI
NtQueryDirectoryObject(HANDLE handle
, PDIRECTORY_BASIC_INFORMATION buffer
,
523 ULONG size
, BOOLEAN single_entry
, BOOLEAN restart
,
524 PULONG context
, PULONG ret_size
)
528 if (restart
) *context
= 0;
532 if (size
<= sizeof(*buffer
) + 2*sizeof(WCHAR
)) return STATUS_BUFFER_OVERFLOW
;
534 SERVER_START_REQ( get_directory_entry
)
536 req
->handle
= wine_server_obj_handle( handle
);
537 req
->index
= *context
;
538 wine_server_set_reply( req
, buffer
+ 1, size
- sizeof(*buffer
) - 2*sizeof(WCHAR
) );
539 if (!(ret
= wine_server_call( req
)))
541 buffer
->ObjectName
.Buffer
= (WCHAR
*)(buffer
+ 1);
542 buffer
->ObjectName
.Length
= reply
->name_len
;
543 buffer
->ObjectName
.MaximumLength
= reply
->name_len
+ sizeof(WCHAR
);
544 buffer
->ObjectTypeName
.Buffer
= (WCHAR
*)(buffer
+ 1) + reply
->name_len
/sizeof(WCHAR
) + 1;
545 buffer
->ObjectTypeName
.Length
= wine_server_reply_size( reply
) - reply
->name_len
;
546 buffer
->ObjectTypeName
.MaximumLength
= buffer
->ObjectTypeName
.Length
+ sizeof(WCHAR
);
547 /* make room for the terminating null */
548 memmove( buffer
->ObjectTypeName
.Buffer
, buffer
->ObjectTypeName
.Buffer
- 1,
549 buffer
->ObjectTypeName
.Length
);
550 buffer
->ObjectName
.Buffer
[buffer
->ObjectName
.Length
/sizeof(WCHAR
)] = 0;
551 buffer
->ObjectTypeName
.Buffer
[buffer
->ObjectTypeName
.Length
/sizeof(WCHAR
)] = 0;
557 *ret_size
= buffer
->ObjectName
.MaximumLength
+ buffer
->ObjectTypeName
.MaximumLength
+ sizeof(*buffer
);
561 FIXME("multiple entries not implemented\n");
562 ret
= STATUS_NOT_IMPLEMENTED
;
572 /******************************************************************************
573 * NtOpenSymbolicLinkObject [NTDLL.@]
574 * ZwOpenSymbolicLinkObject [NTDLL.@]
576 * Open a namespace symbolic link object.
579 * LinkHandle [O] Destination for the new symbolic link handle
580 * DesiredAccess [I] Desired access to the symbolic link
581 * ObjectAttributes [I] Structure describing the symbolic link
584 * Success: ERROR_SUCCESS.
585 * Failure: An NTSTATUS error code.
587 NTSTATUS WINAPI
NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle
, IN ACCESS_MASK DesiredAccess
,
588 IN POBJECT_ATTRIBUTES ObjectAttributes
)
591 TRACE("(%p,0x%08x,%s)\n",LinkHandle
, DesiredAccess
, debugstr_ObjectAttributes(ObjectAttributes
));
593 if (!LinkHandle
) return STATUS_ACCESS_VIOLATION
;
594 if (!ObjectAttributes
) return STATUS_INVALID_PARAMETER
;
595 /* Have to test it here because server won't know difference between
596 * ObjectName == NULL and ObjectName == "" */
597 if (!ObjectAttributes
->ObjectName
)
599 if (ObjectAttributes
->RootDirectory
)
600 return STATUS_OBJECT_NAME_INVALID
;
602 return STATUS_OBJECT_PATH_SYNTAX_BAD
;
605 SERVER_START_REQ(open_symlink
)
607 req
->access
= DesiredAccess
;
608 req
->attributes
= ObjectAttributes
->Attributes
;
609 req
->rootdir
= wine_server_obj_handle( ObjectAttributes
->RootDirectory
);
610 if (ObjectAttributes
->ObjectName
)
611 wine_server_add_data(req
, ObjectAttributes
->ObjectName
->Buffer
,
612 ObjectAttributes
->ObjectName
->Length
);
613 ret
= wine_server_call( req
);
614 *LinkHandle
= wine_server_ptr_handle( reply
->handle
);
620 /******************************************************************************
621 * NtCreateSymbolicLinkObject [NTDLL.@]
622 * ZwCreateSymbolicLinkObject [NTDLL.@]
624 * Open a namespace symbolic link object.
627 * SymbolicLinkHandle [O] Destination for the new symbolic link handle
628 * DesiredAccess [I] Desired access to the symbolic link
629 * ObjectAttributes [I] Structure describing the symbolic link
630 * TargetName [I] Name of the target symbolic link points to
633 * Success: ERROR_SUCCESS.
634 * Failure: An NTSTATUS error code.
636 NTSTATUS WINAPI
NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle
,IN ACCESS_MASK DesiredAccess
,
637 IN POBJECT_ATTRIBUTES ObjectAttributes
,
638 IN PUNICODE_STRING TargetName
)
642 if (!SymbolicLinkHandle
|| !TargetName
) return STATUS_ACCESS_VIOLATION
;
643 if (!TargetName
->Buffer
) return STATUS_INVALID_PARAMETER
;
645 TRACE("(%p,0x%08x,%s -> %s)\n", SymbolicLinkHandle
, DesiredAccess
,
646 debugstr_ObjectAttributes(ObjectAttributes
), debugstr_us(TargetName
));
648 SERVER_START_REQ(create_symlink
)
650 req
->access
= DesiredAccess
;
651 req
->attributes
= ObjectAttributes
? ObjectAttributes
->Attributes
: 0;
652 req
->rootdir
= wine_server_obj_handle( ObjectAttributes
? ObjectAttributes
->RootDirectory
: 0 );
653 if (ObjectAttributes
&& ObjectAttributes
->ObjectName
)
655 req
->name_len
= ObjectAttributes
->ObjectName
->Length
;
656 wine_server_add_data(req
, ObjectAttributes
->ObjectName
->Buffer
,
657 ObjectAttributes
->ObjectName
->Length
);
661 wine_server_add_data(req
, TargetName
->Buffer
, TargetName
->Length
);
662 ret
= wine_server_call( req
);
663 *SymbolicLinkHandle
= wine_server_ptr_handle( reply
->handle
);
669 /******************************************************************************
670 * NtQuerySymbolicLinkObject [NTDLL.@]
671 * ZwQuerySymbolicLinkObject [NTDLL.@]
673 * Query a namespace symbolic link object target name.
676 * handle [I] Handle to a symbolic link object
677 * target [O] Destination for the symbolic link target
678 * length [O] Size of returned data
681 * Success: ERROR_SUCCESS.
682 * Failure: An NTSTATUS error code.
684 NTSTATUS WINAPI
NtQuerySymbolicLinkObject( HANDLE handle
, PUNICODE_STRING target
, PULONG length
)
688 TRACE("(%p,%p,%p)\n", handle
, target
, length
);
690 if (!target
) return STATUS_ACCESS_VIOLATION
;
692 SERVER_START_REQ(query_symlink
)
694 req
->handle
= wine_server_obj_handle( handle
);
695 if (target
->MaximumLength
>= sizeof(WCHAR
))
696 wine_server_set_reply( req
, target
->Buffer
, target
->MaximumLength
- sizeof(WCHAR
) );
697 if (!(ret
= wine_server_call( req
)))
699 target
->Length
= wine_server_reply_size(reply
);
700 target
->Buffer
[target
->Length
/ sizeof(WCHAR
)] = 0;
701 if (length
) *length
= reply
->total
+ sizeof(WCHAR
);
703 else if (length
&& ret
== STATUS_BUFFER_TOO_SMALL
) *length
= reply
->total
+ sizeof(WCHAR
);
709 /******************************************************************************
710 * NtAllocateUuids [NTDLL.@]
712 NTSTATUS WINAPI
NtAllocateUuids(
713 PULARGE_INTEGER Time
,
717 FIXME("(%p,%p,%p), stub.\n", Time
, Range
, Sequence
);
721 /**************************************************************************
722 * NtMakeTemporaryObject [NTDLL.@]
723 * ZwMakeTemporaryObject [NTDLL.@]
725 * Make a permanent object temporary.
728 * Handle [I] handle to permanent object
731 * Success: STATUS_SUCCESS.
732 * Failure: An NTSTATUS error code.
734 NTSTATUS WINAPI
NtMakeTemporaryObject( HANDLE Handle
)
736 FIXME("(%p), stub.\n", Handle
);
737 return STATUS_SUCCESS
;