NTSTATUS
STDCALL
- IntWinStaObjectCreate(PVOID ObjectBody,
- PVOID Parent,
- PWSTR RemainingPath,
- struct _OBJECT_ATTRIBUTES* ObjectAttributes);
-IntWinStaObjectOpen(ULONG Reason,
++IntWinStaObjectOpen(OB_OPEN_REASON Reason,
+ PVOID ObjectBody,
+ PEPROCESS Process,
+ ULONG HandleCount,
+ ACCESS_MASK GrantedAccess);
VOID STDCALL
IntWinStaObjectDelete(PVOID DeletedObject);
struct _ETHREAD *Thread,
BOOLEAN Create);
--/*
-- * Callbacks used for Win32 objects... this define won't be needed after the Object Manager
-- * rewrite -- Alex
-- */
-
-/* TEMPORARY HACK */
--typedef NTSTATUS STDCALL_FUNC
--(*OBJECT_CREATE_ROUTINE)(PVOID ObjectBody,
-- PVOID Parent,
-- PWSTR RemainingPath,
-- struct _OBJECT_ATTRIBUTES* ObjectAttributes);
-
-typedef NTSTATUS STDCALL_FUNC
-(*OBJECT_OPEN_ROUTINE)(ULONG Reason,
- PVOID ObjectBody,
- PEPROCESS Process,
- ULONG HandleCount,
- ACCESS_MASK GrantedAccess);
--
--typedef NTSTATUS STDCALL_FUNC
--(*OBJECT_PARSE_ROUTINE)(PVOID Object,
-- PVOID *NextObject,
-- PUNICODE_STRING FullPath,
-- PWSTR *Path,
-- ULONG Attributes);
--
--typedef VOID STDCALL_FUNC
--(*OBJECT_DELETE_ROUTINE)(PVOID DeletedObject);
--
--typedef PVOID STDCALL_FUNC
--(*OBJECT_FIND_ROUTINE)(PVOID WinStaObject,
-- PWSTR Name,
-- ULONG Attributes);
--
--typedef struct _W32_OBJECT_CALLBACK {
- OBJECT_CREATE_ROUTINE WinStaCreate;
- OBJECT_OPEN_ROUTINE WinStaCreate;
-- OBJECT_PARSE_ROUTINE WinStaParse;
-- OBJECT_DELETE_ROUTINE WinStaDelete;
-- OBJECT_FIND_ROUTINE WinStaFind;
-- OBJECT_CREATE_ROUTINE DesktopCreate;
-- OBJECT_DELETE_ROUTINE DesktopDelete;
--} W32_OBJECT_CALLBACK, *PW32_OBJECT_CALLBACK;
--
VOID STDCALL
PsEstablishWin32Callouts(
PW32_PROCESS_CALLBACK W32ProcessCallback,
NTSTATUS
STDCALL
- IntWinStaObjectCreate(PVOID ObjectBody,
- PVOID Parent,
- PWSTR RemainingPath,
- struct _OBJECT_ATTRIBUTES* ObjectAttributes)
-IntWinStaObjectOpen(ULONG Reason,
++IntWinStaObjectOpen(OB_OPEN_REASON Reason,
+ PVOID ObjectBody,
+ PEPROCESS Process,
+ ULONG HandleCount,
+ ACCESS_MASK GrantedAccess)
{
PWINSTATION_OBJECT WinSta = (PWINSTATION_OBJECT)ObjectBody;
- UNICODE_STRING UnicodeString;
NTSTATUS Status;
- if (RemainingPath == NULL)
- {
- return STATUS_SUCCESS;
- }
-
- if (wcschr((RemainingPath + 1), '\\') != NULL)
- {
- return STATUS_UNSUCCESSFUL;
- }
-
- RtlInitUnicodeString(&UnicodeString, (RemainingPath + 1));
-
- DPRINT("Creating window station (0x%X) Name (%wZ)\n", WinSta, &UnicodeString);
-
- Status = RtlCreateUnicodeString(&WinSta->Name, UnicodeString.Buffer);
- if (!NT_SUCCESS(Status))
+ if (Reason == ObCreateHandle)
{
- return Status;
- }
+ DPRINT("Creating window station (0x%X)\n", WinSta);
- KeInitializeSpinLock(&WinSta->Lock);
+ KeInitializeSpinLock(&WinSta->Lock);
- InitializeListHead(&WinSta->DesktopListHead);
+ InitializeListHead(&WinSta->DesktopListHead);
- WinSta->AtomTable = NULL;
+ WinSta->AtomTable = NULL;
- Status = RtlCreateAtomTable(37, &WinSta->AtomTable);
- if (!NT_SUCCESS(Status))
- {
- RtlFreeUnicodeString(&WinSta->Name);
- return Status;
- }
+ Status = RtlCreateAtomTable(37, &WinSta->AtomTable);
- WinSta->SystemMenuTemplate = (HANDLE)0;
+ WinSta->SystemMenuTemplate = (HANDLE)0;
- DPRINT("Window station successfully created. Name (%wZ)\n", &WinSta->Name);
+ DPRINT("Window station successfully created.\n");
+ }
return STATUS_SUCCESS;
}