mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 08:54:40 +00:00
- Experimental implementation of KsiCreateObjectType
svn path=/trunk/; revision=38940
This commit is contained in:
parent
f5c1cadac1
commit
bf29e0ff1d
|
@ -34,8 +34,39 @@ KsiCreateObjectType( HANDLE hHandle,
|
||||||
ACCESS_MASK DesiredAccess,
|
ACCESS_MASK DesiredAccess,
|
||||||
PHANDLE phHandle)
|
PHANDLE phHandle)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
NTSTATUS Status;
|
||||||
return 0;
|
ULONG Length;
|
||||||
|
ULONG TotalSize;
|
||||||
|
LPWSTR pStr;
|
||||||
|
UNICODE_STRING ObjectName;
|
||||||
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
IO_STATUS_BLOCK IoStatusBlock;
|
||||||
|
|
||||||
|
Length = wcslen(IID);
|
||||||
|
|
||||||
|
TotalSize = (Length * sizeof(WCHAR)) + BufferSize + 2 * sizeof(WCHAR);
|
||||||
|
|
||||||
|
pStr = HeapAlloc(GetProcessHeap(), 0, TotalSize);
|
||||||
|
if (!pStr)
|
||||||
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
|
wcscpy(pStr, (LPWSTR)IID);
|
||||||
|
pStr[Length] = L'\\';
|
||||||
|
memcpy(&pStr[Length+1], Buffer, BufferSize);
|
||||||
|
pStr[Length+1+BufferSize] = L'\0';
|
||||||
|
|
||||||
|
RtlInitUnicodeString(&ObjectName, pStr);
|
||||||
|
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes, &ObjectName, OBJ_CASE_INSENSITIVE, hHandle, NULL);
|
||||||
|
|
||||||
|
Status = NtCreateFile(phHandle, DesiredAccess, &ObjectAttributes, &IoStatusBlock, NULL, FILE_ATTRIBUTE_NORMAL, 0, 1, 0, NULL, 0);
|
||||||
|
HeapFree(GetProcessHeap(), 0, pStr);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
*phHandle = INVALID_HANDLE_VALUE;
|
||||||
|
Status = RtlNtStatusToDosError(Status);
|
||||||
|
}
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*++
|
/*++
|
||||||
|
|
|
@ -1,5 +1,22 @@
|
||||||
|
#ifndef KSUSER_H__
|
||||||
|
#define KSUSER_H__
|
||||||
|
|
||||||
#define _KSDDK_
|
#define _KSDDK_
|
||||||
|
|
||||||
|
#define WIN32_NO_STATUS
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
typedef LONG NTSTATUS;
|
#include <ndk/ntndk.h>
|
||||||
|
|
||||||
|
|
||||||
#include <ks.h>
|
#include <ks.h>
|
||||||
#include <reactos/helper.h>
|
#include <reactos/helper.h>
|
||||||
|
|
||||||
|
LPVOID
|
||||||
|
__stdcall
|
||||||
|
HeapAlloc(
|
||||||
|
HANDLE hHeap,
|
||||||
|
DWORD dwFlags,
|
||||||
|
DWORD dwBytes
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue