mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 08:20:27 +00:00
[NTDLL_WINETEST]
- Avoid printing an unterminated string in registry test. Powered by DPH. - Add a ROS hack to avoid a buffer overflow when one of our DPRINTs is returned by WaitForDebugEvent (e.g. when using DPH) svn path=/trunk/; revision=67382
This commit is contained in:
parent
f83b257104
commit
050de17f6a
2 changed files with 10 additions and 18 deletions
|
@ -959,7 +959,15 @@ static void test_debugger(void)
|
||||||
else if (de.dwDebugEventCode == OUTPUT_DEBUG_STRING_EVENT)
|
else if (de.dwDebugEventCode == OUTPUT_DEBUG_STRING_EVENT)
|
||||||
{
|
{
|
||||||
int stage;
|
int stage;
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
/* This will catch our DPRINTs, such as
|
||||||
|
* "WARNING: RtlpDphTargetDllsLogicInitialize at ..\..\lib\rtl\heappage.c:1283 is UNIMPLEMENTED!"
|
||||||
|
* so we need a full-size buffer to avoid a stack overflow
|
||||||
|
*/
|
||||||
|
char buffer[513];
|
||||||
|
#else
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
|
#endif
|
||||||
|
|
||||||
status = pNtReadVirtualMemory(pi.hProcess, &test_stage, &stage,
|
status = pNtReadVirtualMemory(pi.hProcess, &test_stage, &stage,
|
||||||
sizeof(stage), &size_read);
|
sizeof(stage), &size_read);
|
||||||
|
|
|
@ -204,22 +204,9 @@ static NTSTATUS WINAPI QueryRoutine (IN PCWSTR ValueName, IN ULONG ValueType, IN
|
||||||
IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
|
IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
|
||||||
{
|
{
|
||||||
NTSTATUS ret = STATUS_SUCCESS;
|
NTSTATUS ret = STATUS_SUCCESS;
|
||||||
int ValueNameLength = 0;
|
|
||||||
LPSTR ValName = 0;
|
|
||||||
trace("**Test %d**\n", CurrentTest);
|
trace("**Test %d**\n", CurrentTest);
|
||||||
|
trace("ValueName: %s\n", wine_dbgstr_w(ValueName));
|
||||||
if(ValueName)
|
|
||||||
{
|
|
||||||
ValueNameLength = lstrlenW(ValueName);
|
|
||||||
|
|
||||||
ValName = pRtlAllocateHeap(GetProcessHeap(), 0, ValueNameLength);
|
|
||||||
|
|
||||||
WideCharToMultiByte(CP_ACP, 0, ValueName, ValueNameLength+1, ValName, ValueNameLength, NULL, NULL);
|
|
||||||
|
|
||||||
trace("ValueName: %s\n", ValName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
trace("ValueName: (null)\n");
|
|
||||||
|
|
||||||
switch(ValueType)
|
switch(ValueType)
|
||||||
{
|
{
|
||||||
|
@ -262,9 +249,6 @@ static NTSTATUS WINAPI QueryRoutine (IN PCWSTR ValueName, IN ULONG ValueType, IN
|
||||||
|
|
||||||
CurrentTest++;
|
CurrentTest++;
|
||||||
|
|
||||||
if(ValName)
|
|
||||||
pRtlFreeHeap(GetProcessHeap(), 0, ValName);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue