+/*
+ * KSUSER.DLL - ReactOS
+ *
+ * Copyright 2008 Magnus Olsen and Dmitry Chapyshev
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
#include "ksuser.h"
+#define NDEBUG
+#include <debug.h>
NTSTATUS NTAPI KsiCreateObjectType( HANDLE hHandle, PVOID guidstr, PVOID Buffer, ULONG BufferSize, ACCESS_MASK DesiredAccess, PHANDLE phHandle);
ACCESS_MASK DesiredAccess,
PHANDLE phHandle)
{
- UNIMPLEMENTED
- return 0;
+ NTSTATUS Status;
+ ULONG Length;
+ ULONG TotalSize;
+ LPWSTR pStr;
+ UNICODE_STRING ObjectName;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ IO_STATUS_BLOCK IoStatusBlock;
+
+ Length = wcslen(IID);
+
+ TotalSize = (Length * sizeof(WCHAR)) + BufferSize + 4 * sizeof(WCHAR);
+
+ pStr = HeapAlloc(GetProcessHeap(), 0, TotalSize);
+ if (!pStr)
+ return STATUS_INSUFFICIENT_RESOURCES;
+ pStr[0] = L'\\';
+ wcscpy(&pStr[1], (LPWSTR)IID);
+ pStr[Length+1] = L'\\';
+ memcpy(&pStr[Length+2], Buffer, BufferSize);
+ pStr[Length+3+(BufferSize/sizeof(WCHAR))] = L'\0';
+
+ RtlInitUnicodeString(&ObjectName, pStr);
+ ObjectName.Length = ObjectName.MaximumLength = TotalSize;
+
+ 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;
}
/*++
*--*/
KSDDKAPI
-NTSTATUS
+DWORD
NTAPI
KsCreatePin(HANDLE FilterHandle,
PKSPIN_CONNECT Connect,