ntdll: Implement NtAllocateLocallyUniqueId with server call.

oldstable
Juan Lang 2007-03-06 16:33:26 -08:00 committed by Alexandre Julliard
parent c54a0fc2cf
commit c2cb296277
7 changed files with 76 additions and 11 deletions

View File

@ -1090,25 +1090,28 @@ NTSTATUS WINAPI NtShutdownSystem(SHUTDOWN_ACTION Action)
/******************************************************************************
* NtAllocateLocallyUniqueId (NTDLL.@)
*
* FIXME: the server should do that
*/
NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID Luid)
{
static LUID luid = { SE_MAX_WELL_KNOWN_PRIVILEGE, 0 };
NTSTATUS status;
FIXME("%p\n", Luid);
TRACE("%p\n", Luid);
if (!Luid)
return STATUS_ACCESS_VIOLATION;
luid.LowPart++;
if (luid.LowPart==0)
luid.HighPart++;
Luid->HighPart = luid.HighPart;
Luid->LowPart = luid.LowPart;
SERVER_START_REQ( allocate_locally_unique_id )
{
status = wine_server_call( req );
if (!status)
{
Luid->LowPart = reply->luid.low_part;
Luid->HighPart = reply->luid.high_part;
}
}
SERVER_END_REQ;
return STATUS_SUCCESS;
return status;
}
/******************************************************************************

View File

@ -187,6 +187,12 @@ typedef struct
unsigned short attr;
} char_info_t;
typedef struct
{
unsigned int low_part;
int high_part;
} luid_t;
#define MAX_ACL_LEN 65535
struct security_descriptor
@ -4005,6 +4011,17 @@ struct get_token_impersonation_level_reply
};
struct allocate_locally_unique_id_request
{
struct request_header __header;
};
struct allocate_locally_unique_id_reply
{
struct reply_header __header;
luid_t luid;
};
enum request
{
REQ_new_process,
@ -4224,6 +4241,7 @@ enum request
REQ_query_symlink,
REQ_get_object_info,
REQ_get_token_impersonation_level,
REQ_allocate_locally_unique_id,
REQ_NB_REQUESTS
};
@ -4448,6 +4466,7 @@ union generic_request
struct query_symlink_request query_symlink_request;
struct get_object_info_request get_object_info_request;
struct get_token_impersonation_level_request get_token_impersonation_level_request;
struct allocate_locally_unique_id_request allocate_locally_unique_id_request;
};
union generic_reply
{
@ -4670,8 +4689,9 @@ union generic_reply
struct query_symlink_reply query_symlink_reply;
struct get_object_info_reply get_object_info_reply;
struct get_token_impersonation_level_reply get_token_impersonation_level_reply;
struct allocate_locally_unique_id_reply allocate_locally_unique_id_reply;
};
#define SERVER_PROTOCOL_VERSION 279
#define SERVER_PROTOCOL_VERSION 280
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -203,6 +203,12 @@ typedef struct
unsigned short attr;
} char_info_t;
typedef struct
{
unsigned int low_part;
int high_part;
} luid_t;
#define MAX_ACL_LEN 65535
struct security_descriptor
@ -2870,3 +2876,9 @@ enum message_type
@REPLY
int impersonation_level; /* impersonation level of the impersonation token */
@END
/* Allocate a locally-unique identifier */
@REQ(allocate_locally_unique_id)
@REPLY
luid_t luid;
@END

View File

@ -327,6 +327,7 @@ DECL_HANDLER(open_symlink);
DECL_HANDLER(query_symlink);
DECL_HANDLER(get_object_info);
DECL_HANDLER(get_token_impersonation_level);
DECL_HANDLER(allocate_locally_unique_id);
#ifdef WANT_REQUEST_HANDLERS
@ -550,6 +551,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(req_handler)req_query_symlink,
(req_handler)req_get_object_info,
(req_handler)req_get_token_impersonation_level,
(req_handler)req_allocate_locally_unique_id,
};
#endif /* WANT_REQUEST_HANDLERS */

View File

@ -365,6 +365,15 @@ static inline void allocate_luid( LUID *luid )
*luid = prev_luid_value;
}
DECL_HANDLER( allocate_locally_unique_id )
{
LUID luid;
allocate_luid( &luid );
reply->luid.low_part = luid.LowPart;
reply->luid.high_part = luid.HighPart;
}
static inline void luid_and_attr_from_privilege( LUID_AND_ATTRIBUTES *out, const struct privilege *in)
{
out->Luid = in->luid;

View File

@ -239,6 +239,11 @@ static void dump_apc_result( const apc_result_t *result )
fputc( '}', stderr );
}
static void dump_luid( const luid_t *luid )
{
fprintf( stderr, "%d.%u", luid->high_part, luid->low_part );
}
static void dump_context( const CONTEXT *context )
{
#ifdef __i386__
@ -3454,6 +3459,16 @@ static void dump_get_token_impersonation_level_reply( const struct get_token_imp
fprintf( stderr, " impersonation_level=%d", req->impersonation_level );
}
static void dump_allocate_locally_unique_id_request( const struct allocate_locally_unique_id_request *req )
{
}
static void dump_allocate_locally_unique_id_reply( const struct allocate_locally_unique_id_reply *req )
{
fprintf( stderr, " luid=" );
dump_luid( &req->luid );
}
static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_new_process_request,
(dump_func)dump_get_new_process_info_request,
@ -3672,6 +3687,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_query_symlink_request,
(dump_func)dump_get_object_info_request,
(dump_func)dump_get_token_impersonation_level_request,
(dump_func)dump_allocate_locally_unique_id_request,
};
static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
@ -3892,6 +3908,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_query_symlink_reply,
(dump_func)dump_get_object_info_reply,
(dump_func)dump_get_token_impersonation_level_reply,
(dump_func)dump_allocate_locally_unique_id_reply,
};
static const char * const req_names[REQ_NB_REQUESTS] = {
@ -4112,6 +4129,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"query_symlink",
"get_object_info",
"get_token_impersonation_level",
"allocate_locally_unique_id",
};
static const struct

View File

@ -44,6 +44,7 @@ my %formats =
"char_info_t" => "&dump_char_info",
"apc_call_t" => "&dump_apc_call",
"apc_result_t" => "&dump_apc_result",
"luid_t" => "&dump_luid",
);
my @requests = ();