Author: cfinck
Date: Sun Mar 13 21:55:49 2011
New Revision: 51043
URL:
http://svn.reactos.org/svn/reactos?rev=51043&view=rev
Log:
Michael Martin
- Fix "EnableUserModePnpManager() failed!" in second stage setup.
Tested by Eric Kohl and igorko.
See issue #5989 for more details.
Modified:
trunk/reactos/dll/win32/kernel32/file/npipe.c
trunk/reactos/dll/win32/rpcrt4/rpc_transport.c
trunk/reactos/dll/win32/syssetup/install.c
trunk/reactos/drivers/filesystems/npfs/fsctrl.c
Modified: trunk/reactos/dll/win32/kernel32/file/npipe.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/np…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/npipe.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/npipe.c [iso-8859-1] Sun Mar 13 21:55:49 2011
@@ -501,19 +501,19 @@
}
/* Check what timeout we got */
- if (nTimeOut == NMPWAIT_USE_DEFAULT_WAIT)
+ if (nTimeOut == NMPWAIT_WAIT_FOREVER)
{
/* Don't use a timeout */
WaitPipe.TimeoutSpecified = FALSE;
}
else
{
- /* Check if we should wait forever */
- if (nTimeOut == NMPWAIT_WAIT_FOREVER)
- {
- /* Set the max */
+ /* Check if default */
+ if (nTimeOut == NMPWAIT_USE_DEFAULT_WAIT)
+ {
+ /* Set it to 0 */
WaitPipe.Timeout.LowPart = 0;
- WaitPipe.Timeout.HighPart = 0x80000000;
+ WaitPipe.Timeout.HighPart = 0;
}
else
{
Modified: trunk/reactos/dll/win32/rpcrt4/rpc_transport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/rpc_trans…
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/rpcrt4/rpc_transport.c [iso-8859-1] Sun Mar 13 21:55:49 2011
@@ -219,13 +219,20 @@
if (pipe != INVALID_HANDLE_VALUE) break;
err = GetLastError();
if (err == ERROR_PIPE_BUSY) {
- TRACE("connection failed, error=%x\n", err);
+ ERR("connection to %s failed, error=%x\n", pname, err);
return RPC_S_SERVER_TOO_BUSY;
}
- if (!wait || !WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) {
- err = GetLastError();
- WARN("connection failed, error=%x\n", err);
- return RPC_S_SERVER_UNAVAILABLE;
+ if (wait) ERR("Waiting for Pipe Instance\n");
+ if (wait) {
+ if (!WaitNamedPipeA(pname, NMPWAIT_WAIT_FOREVER)) {
+ err = GetLastError();
+ ERR("connection to %s failed, error=%x, wait %x\n", pname, err,
wait);
+ return RPC_S_SERVER_UNAVAILABLE;
+ }
+ else
+ {
+ ERR("Pipe Instance Ready!!!!!!!!!!!!!!!!!!\n");
+ }
}
}
@@ -314,7 +321,7 @@
/* protseq=ncacn_np: named pipes */
pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1);
strcat(strcpy(pname, prefix), Connection->Endpoint);
- r = rpcrt4_conn_open_pipe(Connection, pname, FALSE);
+ r = rpcrt4_conn_open_pipe(Connection, pname, TRUE);
I_RpcFree(pname);
return r;
Modified: trunk/reactos/dll/win32/syssetup/install.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/install…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] Sun Mar 13 21:55:49 2011
@@ -481,6 +481,7 @@
if (hSCManager == NULL)
{
DPRINT1("Unable to open the service control manager.\n");
+ DPRINT1("Last Error %d\n", GetLastError());
goto cleanup;
}
Modified: trunk/reactos/drivers/filesystems/npfs/fsctrl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs/fsctrl.c [iso-8859-1] Sun Mar 13 21:55:49 2011
@@ -317,9 +317,105 @@
return Status;
}
-
static NTSTATUS
NpfsWaitPipe(PIRP Irp,
+ PNPFS_CCB Ccb)
+{
+ PLIST_ENTRY current_entry;
+ PNPFS_FCB Fcb;
+ PNPFS_CCB ServerCcb;
+ PFILE_PIPE_WAIT_FOR_BUFFER WaitPipe;
+ PLARGE_INTEGER TimeOut;
+ NTSTATUS Status;
+ PEXTENDED_IO_STACK_LOCATION IoStack;
+ PFILE_OBJECT FileObject;
+ PNPFS_VCB Vcb;
+
+ IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp);
+ ASSERT(IoStack);
+ FileObject = IoStack->FileObject;
+ ASSERT(FileObject);
+
+ DPRINT1("Waiting on Pipe %wZ\n", &FileObject->FileName);
+
+ WaitPipe = (PFILE_PIPE_WAIT_FOR_BUFFER)Irp->AssociatedIrp.SystemBuffer;
+
+ ASSERT(Ccb->Fcb);
+ ASSERT(Ccb->Fcb->Vcb);
+
+ /* Get the VCB */
+ Vcb = Ccb->Fcb->Vcb;
+
+ /* Lock the pipe list */
+ KeLockMutex(&Vcb->PipeListLock);
+
+ /* File a pipe with the given name */
+ Fcb = NpfsFindPipe(Vcb,
+ &FileObject->FileName);
+
+ /* Unlock the pipe list */
+ KeUnlockMutex(&Vcb->PipeListLock);
+
+ /* Fail if not pipe was found */
+ if (Fcb == NULL)
+ {
+ DPRINT1("No pipe found!\n", Fcb);
+ return STATUS_OBJECT_NAME_NOT_FOUND;
+ }
+
+ /* search for listening server */
+ current_entry = Fcb->ServerCcbListHead.Flink;
+ while (current_entry != &Fcb->ServerCcbListHead)
+ {
+ ServerCcb = CONTAINING_RECORD(current_entry,
+ NPFS_CCB,
+ CcbListEntry);
+
+ if (ServerCcb->PipeState == FILE_PIPE_LISTENING_STATE)
+ {
+ /* found a listening server CCB */
+ DPRINT("Listening server CCB found -- connecting\n");
+
+ return STATUS_SUCCESS;
+ }
+
+ current_entry = current_entry->Flink;
+ }
+
+ /* No listening server fcb found, so wait for one */
+
+ /* If a timeout specified */
+ if (WaitPipe->TimeoutSpecified)
+ {
+ /* NMPWAIT_USE_DEFAULT_WAIT = 0 */
+ if (WaitPipe->Timeout.QuadPart == 0)
+ {
+ TimeOut = &Fcb->TimeOut;
+ }
+ else
+ {
+ TimeOut = &WaitPipe->Timeout;
+ }
+ }
+ else
+ {
+ /* Wait forever */
+ TimeOut = NULL;
+ }
+
+ Status = KeWaitForSingleObject(&Ccb->ConnectEvent,
+ UserRequest,
+ KernelMode,
+ TRUE,
+ TimeOut);
+
+ DPRINT("KeWaitForSingleObject() returned (Status %lx)\n", Status);
+
+ return Status;
+}
+
+NTSTATUS
+NpfsWaitPipe2(PIRP Irp,
PNPFS_CCB Ccb)
{
PLIST_ENTRY current_entry;