mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Update indentation.
svn path=/trunk/; revision=18686
This commit is contained in:
parent
cf54e94b6e
commit
1060e47c32
3 changed files with 997 additions and 978 deletions
|
@ -343,7 +343,6 @@ ScmCreateServiceDataBase(VOID)
|
|||
{
|
||||
if (KeyInfo->NameLength < MAX_PATH * sizeof(WCHAR))
|
||||
{
|
||||
|
||||
SubKeyName.Length = KeyInfo->NameLength;
|
||||
SubKeyName.MaximumLength = KeyInfo->NameLength + sizeof(WCHAR);
|
||||
SubKeyName.Buffer = KeyInfo->Name;
|
||||
|
@ -446,7 +445,8 @@ ScmCheckDriver(PSERVICE Service)
|
|||
|
||||
if (_wcsicmp(Service->lpServiceName, DirInfo->ObjectName.Buffer) == 0)
|
||||
{
|
||||
DPRINT("Found: '%S' '%wZ'\n", Service->lpServiceName, &DirInfo->ObjectName);
|
||||
DPRINT("Found: '%S' '%wZ'\n",
|
||||
Service->lpServiceName, &DirInfo->ObjectName);
|
||||
|
||||
/* Mark service as 'running' */
|
||||
Service->Status.dwCurrentState = SERVICE_RUNNING;
|
||||
|
@ -502,6 +502,7 @@ ScmGetBootAndSystemDriverState(VOID)
|
|||
|
||||
ScmCheckDriver(CurrentService);
|
||||
}
|
||||
|
||||
ServiceEntry = ServiceEntry->Flink;
|
||||
}
|
||||
|
||||
|
|
|
@ -431,7 +431,9 @@ ScmrQueryServiceStatus(handle_t BindingHandle,
|
|||
}
|
||||
|
||||
/* Return service status information */
|
||||
RtlCopyMemory(lpServiceStatus, &lpService->Status, sizeof(SERVICE_STATUS));
|
||||
RtlCopyMemory(lpServiceStatus,
|
||||
&lpService->Status,
|
||||
sizeof(SERVICE_STATUS));
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -113,38 +113,47 @@ ScmNamedPipeThread(LPVOID Context)
|
|||
DWORD cbReplyBytes;
|
||||
DWORD cbBytesRead;
|
||||
DWORD cbWritten;
|
||||
BOOL fSuccess;
|
||||
BOOL bSuccess;
|
||||
HANDLE hPipe;
|
||||
|
||||
hPipe = (HANDLE)Context;
|
||||
|
||||
DPRINT("ScmNamedPipeThread(%x) - Accepting SCM commands through named pipe\n", hPipe);
|
||||
|
||||
for (;;) {
|
||||
fSuccess = ReadFile(hPipe,
|
||||
for (;;)
|
||||
{
|
||||
bSuccess = ReadFile(hPipe,
|
||||
&chRequest,
|
||||
PIPE_BUFSIZE,
|
||||
&cbBytesRead,
|
||||
NULL);
|
||||
if (!fSuccess || cbBytesRead == 0) {
|
||||
if (!bSuccess || cbBytesRead == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (ScmNamedPipeHandleRequest(&chRequest, cbBytesRead, &chReply, &cbReplyBytes)) {
|
||||
fSuccess = WriteFile(hPipe,
|
||||
|
||||
if (ScmNamedPipeHandleRequest(&chRequest, cbBytesRead, &chReply, &cbReplyBytes))
|
||||
{
|
||||
bSuccess = WriteFile(hPipe,
|
||||
&chReply,
|
||||
cbReplyBytes,
|
||||
&cbWritten,
|
||||
NULL);
|
||||
if (!fSuccess || cbReplyBytes != cbWritten) {
|
||||
if (!bSuccess || cbReplyBytes != cbWritten)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DPRINT("ScmNamedPipeThread(%x) - Disconnecting named pipe connection\n", hPipe);
|
||||
|
||||
FlushFileBuffers(hPipe);
|
||||
DisconnectNamedPipe(hPipe);
|
||||
CloseHandle(hPipe);
|
||||
|
||||
DPRINT("ScmNamedPipeThread(%x) - Done.\n", hPipe);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -153,7 +162,7 @@ BOOL
|
|||
ScmCreateNamedPipe(VOID)
|
||||
{
|
||||
DWORD dwThreadId;
|
||||
BOOL fConnected;
|
||||
BOOL bConnected;
|
||||
HANDLE hThread;
|
||||
HANDLE hPipe;
|
||||
|
||||
|
@ -167,17 +176,19 @@ ScmCreateNamedPipe(VOID)
|
|||
PIPE_BUFSIZE,
|
||||
PIPE_TIMEOUT,
|
||||
NULL);
|
||||
if (hPipe == INVALID_HANDLE_VALUE) {
|
||||
if (hPipe == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DPRINT("CreateNamedPipe() failed (%d)\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DPRINT("CreateNamedPipe() - calling ConnectNamedPipe(%x)\n", hPipe);
|
||||
fConnected = ConnectNamedPipe(hPipe,
|
||||
bConnected = ConnectNamedPipe(hPipe,
|
||||
NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED);
|
||||
DPRINT("CreateNamedPipe() - ConnectNamedPipe() returned %d\n", fConnected);
|
||||
DPRINT("CreateNamedPipe() - ConnectNamedPipe() returned %d\n", bConnected);
|
||||
|
||||
if (fConnected) {
|
||||
if (bConnected)
|
||||
{
|
||||
DPRINT("Pipe connected\n");
|
||||
hThread = CreateThread(NULL,
|
||||
0,
|
||||
|
@ -185,14 +196,17 @@ ScmCreateNamedPipe(VOID)
|
|||
(LPVOID)hPipe,
|
||||
0,
|
||||
&dwThreadId);
|
||||
if (!hThread) {
|
||||
if (!hThread)
|
||||
{
|
||||
DPRINT("Could not create thread (%d)\n", GetLastError());
|
||||
DisconnectNamedPipe(hPipe);
|
||||
CloseHandle(hPipe);
|
||||
DPRINT("CreateNamedPipe() - returning FALSE\n");
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT("Pipe not connected\n");
|
||||
CloseHandle(hPipe);
|
||||
DPRINT("CreateNamedPipe() - returning FALSE\n");
|
||||
|
@ -210,10 +224,12 @@ ScmNamedPipeListenerThread(LPVOID Context)
|
|||
DPRINT("ScmNamedPipeListenerThread(%x) - aka SCM.\n", Context);
|
||||
|
||||
// hPipe = (HANDLE)Context;
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
DPRINT("SCM: Waiting for new connection on named pipe...\n");
|
||||
/* Create named pipe */
|
||||
if (!ScmCreateNamedPipe()) {
|
||||
if (!ScmCreateNamedPipe())
|
||||
{
|
||||
DPRINT1("\nSCM: Failed to create named pipe\n");
|
||||
break;
|
||||
//ExitThread(0);
|
||||
|
|
Loading…
Reference in a new issue