mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 01:42:30 +00:00
[KERNEL32] Don't hardcode some types in sizeofs, and some flag values.
This commit is contained in:
parent
993eb07654
commit
d6d30f9e05
|
@ -76,7 +76,7 @@ NpGetUserNamep(HANDLE hNamedPipe,
|
|||
|
||||
/* Restore the thread token */
|
||||
Status = NtSetInformationThread(NtCurrentThread(), ThreadImpersonationToken,
|
||||
&hToken, sizeof(HANDLE));
|
||||
&hToken, sizeof(hToken));
|
||||
/* We cannot fail closing the thread token! */
|
||||
if (!CloseHandle(hToken))
|
||||
{
|
||||
|
@ -796,7 +796,7 @@ SetNamedPipeHandleState(HANDLE hNamedPipe,
|
|||
Status = NtSetInformationFile(hNamedPipe,
|
||||
&Iosb,
|
||||
&Settings,
|
||||
sizeof(FILE_PIPE_INFORMATION),
|
||||
sizeof(Settings),
|
||||
FilePipeInformation);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -816,7 +816,7 @@ SetNamedPipeHandleState(HANDLE hNamedPipe,
|
|||
Status = NtQueryInformationFile(hNamedPipe,
|
||||
&Iosb,
|
||||
&RemoteSettings,
|
||||
sizeof(FILE_PIPE_REMOTE_INFORMATION),
|
||||
sizeof(RemoteSettings),
|
||||
FilePipeRemoteInformation);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -839,7 +839,7 @@ SetNamedPipeHandleState(HANDLE hNamedPipe,
|
|||
Status = NtSetInformationFile(hNamedPipe,
|
||||
&Iosb,
|
||||
&RemoteSettings,
|
||||
sizeof(FILE_PIPE_REMOTE_INFORMATION),
|
||||
sizeof(RemoteSettings),
|
||||
FilePipeRemoteInformation);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -1017,7 +1017,7 @@ GetNamedPipeHandleStateW(HANDLE hNamedPipe,
|
|||
Status = NtQueryInformationFile(hNamedPipe,
|
||||
&StatusBlock,
|
||||
&PipeInfo,
|
||||
sizeof(FILE_PIPE_INFORMATION),
|
||||
sizeof(PipeInfo),
|
||||
FilePipeInformation);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -1036,7 +1036,7 @@ GetNamedPipeHandleStateW(HANDLE hNamedPipe,
|
|||
Status = NtQueryInformationFile(hNamedPipe,
|
||||
&StatusBlock,
|
||||
&LocalInfo,
|
||||
sizeof(FILE_PIPE_LOCAL_INFORMATION),
|
||||
sizeof(LocalInfo),
|
||||
FilePipeLocalInformation);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -1054,7 +1054,7 @@ GetNamedPipeHandleStateW(HANDLE hNamedPipe,
|
|||
Status = NtQueryInformationFile(hNamedPipe,
|
||||
&StatusBlock,
|
||||
&RemoteInfo,
|
||||
sizeof(FILE_PIPE_REMOTE_INFORMATION),
|
||||
sizeof(RemoteInfo),
|
||||
FilePipeRemoteInformation);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -1174,7 +1174,7 @@ GetNamedPipeInfo(HANDLE hNamedPipe,
|
|||
Status = NtQueryInformationFile(hNamedPipe,
|
||||
&StatusBlock,
|
||||
&PipeLocalInformation,
|
||||
sizeof(FILE_PIPE_LOCAL_INFORMATION),
|
||||
sizeof(PipeLocalInformation),
|
||||
FilePipeLocalInformation);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -1185,7 +1185,7 @@ GetNamedPipeInfo(HANDLE hNamedPipe,
|
|||
if (lpFlags != NULL)
|
||||
{
|
||||
*lpFlags = (PipeLocalInformation.NamedPipeEnd == FILE_PIPE_SERVER_END) ? PIPE_SERVER_END : PIPE_CLIENT_END;
|
||||
*lpFlags |= (PipeLocalInformation.NamedPipeType == 1) ? PIPE_TYPE_MESSAGE : PIPE_TYPE_BYTE;
|
||||
*lpFlags |= (PipeLocalInformation.NamedPipeType == FILE_PIPE_MESSAGE_TYPE) ? PIPE_TYPE_MESSAGE : PIPE_TYPE_BYTE;
|
||||
}
|
||||
|
||||
if (lpOutBufferSize != NULL)
|
||||
|
|
|
@ -677,7 +677,7 @@ GetModuleHandleForUnicodeString(PUNICODE_STRING ModuleName)
|
|||
if (NT_SUCCESS(Status)) return Module;
|
||||
|
||||
/* If not, then the path should be computed */
|
||||
DllPath = BaseComputeProcessDllPath(NULL, 0);
|
||||
DllPath = BaseComputeProcessDllPath(NULL, NULL);
|
||||
if (!DllPath)
|
||||
{
|
||||
Status = STATUS_NO_MEMORY;
|
||||
|
|
Loading…
Reference in a new issue