mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 06:25:49 +00:00
[KERNEL32]: Formatting fixes (whitespace...) only.
svn path=/trunk/; revision=71768
This commit is contained in:
parent
12df37e35b
commit
1feab2643f
2 changed files with 239 additions and 241 deletions
|
@ -71,13 +71,13 @@ K32CreateDBMonMutex(void)
|
|||
TRUE,
|
||||
L"DBWinMutex");
|
||||
|
||||
if(hMutex != NULL)
|
||||
if (hMutex != NULL)
|
||||
{
|
||||
/* success */
|
||||
return hMutex;
|
||||
}
|
||||
/* error other than the mutex not being found */
|
||||
else if(GetLastError() != ERROR_FILE_NOT_FOUND)
|
||||
else if (GetLastError() != ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
/* failure */
|
||||
return NULL;
|
||||
|
@ -100,7 +100,7 @@ K32CreateDBMonMutex(void)
|
|||
&psidSystem);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
if (!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
|
||||
/* allocate the BUILTIN\Administrators SID */
|
||||
nErrCode = RtlAllocateAndInitializeSid(&siaNTAuth,
|
||||
|
@ -116,7 +116,7 @@ K32CreateDBMonMutex(void)
|
|||
&psidAdministrators);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
if (!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
|
||||
/* allocate the Everyone SID */
|
||||
nErrCode = RtlAllocateAndInitializeSid(&siaWorldAuth,
|
||||
|
@ -132,7 +132,7 @@ K32CreateDBMonMutex(void)
|
|||
&psidEveryone);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
if (!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
|
||||
/* allocate space for the SIDs too */
|
||||
nDaclBufSize += RtlLengthSid(psidSystem);
|
||||
|
@ -143,13 +143,13 @@ K32CreateDBMonMutex(void)
|
|||
pDaclBuf = GlobalAlloc(GMEM_FIXED, nDaclBufSize);
|
||||
|
||||
/* failure */
|
||||
if(pDaclBuf == NULL) goto l_Cleanup;
|
||||
if (pDaclBuf == NULL) goto l_Cleanup;
|
||||
|
||||
/* create the DACL */
|
||||
nErrCode = RtlCreateAcl(pDaclBuf, nDaclBufSize, ACL_REVISION);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
if (!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
|
||||
/* grant the minimum required access to Everyone */
|
||||
nErrCode = RtlAddAccessAllowedAce(pDaclBuf,
|
||||
|
@ -160,7 +160,7 @@ K32CreateDBMonMutex(void)
|
|||
psidEveryone);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
if (!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
|
||||
/* grant full access to BUILTIN\Administrators */
|
||||
nErrCode = RtlAddAccessAllowedAce(pDaclBuf,
|
||||
|
@ -169,7 +169,7 @@ K32CreateDBMonMutex(void)
|
|||
psidAdministrators);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
if (!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
|
||||
/* grant full access to NT AUTHORITY\SYSTEM */
|
||||
nErrCode = RtlAddAccessAllowedAce(pDaclBuf,
|
||||
|
@ -178,14 +178,14 @@ K32CreateDBMonMutex(void)
|
|||
psidSystem);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
if (!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
|
||||
/* create the security descriptor */
|
||||
nErrCode = RtlCreateSecurityDescriptor(&sdMutexSecurity,
|
||||
SECURITY_DESCRIPTOR_REVISION);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
if (!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
|
||||
/* set the descriptor's DACL to the ACL we created */
|
||||
nErrCode = RtlSetDaclSecurityDescriptor(&sdMutexSecurity,
|
||||
|
@ -194,17 +194,17 @@ K32CreateDBMonMutex(void)
|
|||
FALSE);
|
||||
|
||||
/* failure */
|
||||
if(!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
if (!NT_SUCCESS(nErrCode)) goto l_Cleanup;
|
||||
|
||||
/* create the mutex */
|
||||
hMutex = CreateMutexW(&saMutexAttribs, FALSE, L"DBWinMutex");
|
||||
|
||||
l_Cleanup:
|
||||
/* free the buffers */
|
||||
if(pDaclBuf) GlobalFree(pDaclBuf);
|
||||
if(psidEveryone) RtlFreeSid(psidEveryone);
|
||||
if(psidAdministrators) RtlFreeSid(psidAdministrators);
|
||||
if(psidSystem) RtlFreeSid(psidSystem);
|
||||
if (pDaclBuf) GlobalFree(pDaclBuf);
|
||||
if (psidEveryone) RtlFreeSid(psidEveryone);
|
||||
if (psidAdministrators) RtlFreeSid(psidAdministrators);
|
||||
if (psidSystem) RtlFreeSid(psidSystem);
|
||||
|
||||
return hMutex;
|
||||
}
|
||||
|
@ -425,8 +425,8 @@ CheckRemoteDebuggerPresent(IN HANDLE hProcess,
|
|||
/* Check if the process has a debug object/port */
|
||||
Status = NtQueryInformationProcess(hProcess,
|
||||
ProcessDebugPort,
|
||||
(PVOID)&DebugPort,
|
||||
sizeof(HANDLE),
|
||||
&DebugPort,
|
||||
sizeof(DebugPort),
|
||||
NULL);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -558,7 +558,7 @@ DebugBreakProcess(IN HANDLE Process)
|
|||
|
||||
/* Send the breakin request */
|
||||
Status = DbgUiIssueRemoteBreakin(Process);
|
||||
if(!NT_SUCCESS(Status))
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Failure */
|
||||
BaseSetLastNTError(Status);
|
||||
|
@ -765,7 +765,7 @@ OutputDebugStringA(IN LPCSTR _OutputString)
|
|||
volatile HANDLE hDBMonDataReady = NULL;
|
||||
|
||||
/* mutex not opened, and no previous attempts to open/create it */
|
||||
if(hDBMonMutex == NULL && !s_bDBMonMutexTriedOpen)
|
||||
if (hDBMonMutex == NULL && !s_bDBMonMutexTriedOpen)
|
||||
{
|
||||
/* open/create the mutex */
|
||||
hDBMonMutex = K32CreateDBMonMutex();
|
||||
|
@ -778,7 +778,7 @@ OutputDebugStringA(IN LPCSTR _OutputString)
|
|||
volatile PCHAR a_cBuffer = NULL;
|
||||
|
||||
/* opening the mutex failed */
|
||||
if(hDBMonMutex == NULL)
|
||||
if (hDBMonMutex == NULL)
|
||||
{
|
||||
/* remember next time */
|
||||
s_bDBMonMutexTriedOpen = TRUE;
|
||||
|
@ -795,7 +795,7 @@ OutputDebugStringA(IN LPCSTR _OutputString)
|
|||
hDBMonBuffer = OpenFileMappingW(SECTION_MAP_WRITE, FALSE, L"DBWIN_BUFFER");
|
||||
|
||||
/* couldn't open the buffer: send the string to the kernel debugger */
|
||||
if(hDBMonBuffer == NULL) break;
|
||||
if (hDBMonBuffer == NULL) break;
|
||||
|
||||
/* map the buffer */
|
||||
pDBMonBuffer = MapViewOfFile(hDBMonBuffer,
|
||||
|
@ -805,13 +805,13 @@ OutputDebugStringA(IN LPCSTR _OutputString)
|
|||
0);
|
||||
|
||||
/* couldn't map the buffer: send the string to the kernel debugger */
|
||||
if(pDBMonBuffer == NULL) break;
|
||||
if (pDBMonBuffer == NULL) break;
|
||||
|
||||
/* open the event signaling that the buffer can be accessed */
|
||||
hDBMonBufferReady = OpenEventW(SYNCHRONIZE, FALSE, L"DBWIN_BUFFER_READY");
|
||||
|
||||
/* couldn't open the event: send the string to the kernel debugger */
|
||||
if(hDBMonBufferReady == NULL) break;
|
||||
if (hDBMonBufferReady == NULL) break;
|
||||
|
||||
/* open the event to be signaled when the buffer has been filled */
|
||||
hDBMonDataReady = OpenEventW(EVENT_MODIFY_STATE, FALSE, L"DBWIN_DATA_READY");
|
||||
|
@ -820,7 +820,7 @@ OutputDebugStringA(IN LPCSTR _OutputString)
|
|||
|
||||
/* we couldn't connect to the system-wide debug message monitor: send the
|
||||
string to the kernel debugger */
|
||||
if(hDBMonDataReady == NULL) ReleaseMutex(hDBMonMutex);
|
||||
if (hDBMonDataReady == NULL) ReleaseMutex(hDBMonMutex);
|
||||
}
|
||||
|
||||
_SEH2_TRY
|
||||
|
@ -838,11 +838,11 @@ OutputDebugStringA(IN LPCSTR _OutputString)
|
|||
{
|
||||
/* we're connected to the debug monitor:
|
||||
write the current block to the shared buffer */
|
||||
if(hDBMonDataReady)
|
||||
if (hDBMonDataReady)
|
||||
{
|
||||
/* wait a maximum of 10 seconds for the debug monitor
|
||||
to finish processing the shared buffer */
|
||||
if(WaitForSingleObject(hDBMonBufferReady, 10000) != WAIT_OBJECT_0)
|
||||
if (WaitForSingleObject(hDBMonBufferReady, 10000) != WAIT_OBJECT_0)
|
||||
{
|
||||
/* timeout or failure: give up */
|
||||
break;
|
||||
|
@ -852,7 +852,7 @@ OutputDebugStringA(IN LPCSTR _OutputString)
|
|||
pDBMonBuffer->ProcessId = GetCurrentProcessId();
|
||||
|
||||
/* write only as many bytes as they fit in the buffer */
|
||||
if(nOutputStringLen > (PAGE_SIZE - sizeof(DWORD) - 1))
|
||||
if (nOutputStringLen > (PAGE_SIZE - sizeof(DWORD) - 1))
|
||||
nRoundLen = PAGE_SIZE - sizeof(DWORD) - 1;
|
||||
else
|
||||
nRoundLen = nOutputStringLen;
|
||||
|
@ -879,7 +879,7 @@ OutputDebugStringA(IN LPCSTR _OutputString)
|
|||
}
|
||||
|
||||
/* write a maximum of 511 bytes */
|
||||
if(nOutputStringLen > 510)
|
||||
if (nOutputStringLen > 510)
|
||||
nRoundLen = 510;
|
||||
else
|
||||
nRoundLen = nOutputStringLen;
|
||||
|
@ -921,13 +921,13 @@ OutputDebugStringA(IN LPCSTR _OutputString)
|
|||
_SEH2_FINALLY
|
||||
{
|
||||
/* close all the still open resources */
|
||||
if(hDBMonBufferReady) CloseHandle(hDBMonBufferReady);
|
||||
if(pDBMonBuffer) UnmapViewOfFile(pDBMonBuffer);
|
||||
if(hDBMonBuffer) CloseHandle(hDBMonBuffer);
|
||||
if(hDBMonDataReady) CloseHandle(hDBMonDataReady);
|
||||
if (hDBMonBufferReady) CloseHandle(hDBMonBufferReady);
|
||||
if (pDBMonBuffer) UnmapViewOfFile(pDBMonBuffer);
|
||||
if (hDBMonBuffer) CloseHandle(hDBMonBuffer);
|
||||
if (hDBMonDataReady) CloseHandle(hDBMonDataReady);
|
||||
|
||||
/* leave the critical section */
|
||||
if(hDBMonDataReady != NULL)
|
||||
if (hDBMonDataReady != NULL)
|
||||
ReleaseMutex(hDBMonMutex);
|
||||
}
|
||||
_SEH2_END;
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* PROJECT: ReactOS system libraries
|
||||
* FILE: dll/win32/kernel32/client/except.c
|
||||
* PURPOSE: Exception functions
|
||||
* PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
|
||||
* modified from WINE [ Onno Hovers, (onno@stack.urc.tue.nl) ]
|
||||
* PROGRAMMER: Ariadne (ariadne@xs4all.nl)
|
||||
* Modified from WINE [ Onno Hovers, (onno@stack.urc.tue.nl) ]
|
||||
* UPDATE HISTORY:
|
||||
* Created 01/11/98
|
||||
*/
|
||||
|
@ -69,19 +69,19 @@ _dump_context(PCONTEXT pc)
|
|||
DbgPrint("R8: %08lx R9: %08lx R10: %08lx R11: %08lx\n", pc->R8, pc->R9, pc->R10, pc->R11);
|
||||
DbgPrint("R12: %08lx CPSR: %08lx FPSCR: %08lx\n", pc->R12, pc->Cpsr, pc->R1, pc->Fpscr, pc->R3);
|
||||
#else
|
||||
#error "Unknown architecture"
|
||||
#error "Unknown architecture"
|
||||
#endif
|
||||
}
|
||||
|
||||
static VOID
|
||||
PrintStackTrace(struct _EXCEPTION_POINTERS *ExceptionInfo)
|
||||
PrintStackTrace(IN PEXCEPTION_POINTERS ExceptionInfo)
|
||||
{
|
||||
PVOID StartAddr;
|
||||
CHAR szMod[128] = "";
|
||||
PEXCEPTION_RECORD ExceptionRecord = ExceptionInfo->ExceptionRecord;
|
||||
PCONTEXT ContextRecord = ExceptionInfo->ContextRecord;
|
||||
|
||||
/* Print a stack trace. */
|
||||
/* Print a stack trace */
|
||||
DbgPrint("Unhandled exception\n");
|
||||
DbgPrint("ExceptionCode: %8x\n", ExceptionRecord->ExceptionCode);
|
||||
|
||||
|
@ -91,7 +91,7 @@ PrintStackTrace(struct _EXCEPTION_POINTERS *ExceptionInfo)
|
|||
DbgPrint("Faulting Address: %8x\n", ExceptionRecord->ExceptionInformation[1]);
|
||||
}
|
||||
|
||||
_dump_context (ContextRecord);
|
||||
_dump_context(ContextRecord);
|
||||
_module_name_from_addr(ExceptionRecord->ExceptionAddress, &StartAddr, szMod, sizeof(szMod));
|
||||
DbgPrint("Address:\n %8x+%-8x %s\n",
|
||||
(PVOID)StartAddr,
|
||||
|
@ -368,9 +368,7 @@ RaiseException(IN DWORD dwExceptionCode,
|
|||
{
|
||||
/* We do, normalize the count */
|
||||
if (nNumberOfArguments > EXCEPTION_MAXIMUM_PARAMETERS)
|
||||
{
|
||||
nNumberOfArguments = EXCEPTION_MAXIMUM_PARAMETERS;
|
||||
}
|
||||
|
||||
/* Set the count of parameters and copy them */
|
||||
ExceptionRecord.NumberParameters = nNumberOfArguments;
|
||||
|
@ -388,7 +386,7 @@ RaiseException(IN DWORD dwExceptionCode,
|
|||
}
|
||||
|
||||
/* Trace the wine special error and show the modulename and functionname */
|
||||
if (dwExceptionCode == 0x80000100 /*EXCEPTION_WINE_STUB*/)
|
||||
if (dwExceptionCode == 0x80000100 /* EXCEPTION_WINE_STUB */)
|
||||
{
|
||||
/* Numbers of parameter must be equal to two */
|
||||
if (ExceptionRecord.NumberParameters == 2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue