Author: tfaber
Date: Fri Apr 24 17:37:31 2015
New Revision: 67382
URL:
http://svn.reactos.org/svn/reactos?rev=67382&view=rev
Log:
[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)
Modified:
trunk/rostests/winetests/ntdll/exception.c
trunk/rostests/winetests/ntdll/reg.c
Modified: trunk/rostests/winetests/ntdll/exception.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/exception…
==============================================================================
--- trunk/rostests/winetests/ntdll/exception.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/exception.c [iso-8859-1] Fri Apr 24 17:37:31 2015
@@ -959,7 +959,15 @@
else if (de.dwDebugEventCode == OUTPUT_DEBUG_STRING_EVENT)
{
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];
+#endif
status = pNtReadVirtualMemory(pi.hProcess, &test_stage, &stage,
sizeof(stage), &size_read);
Modified: trunk/rostests/winetests/ntdll/reg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/reg.c?rev…
==============================================================================
--- trunk/rostests/winetests/ntdll/reg.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ntdll/reg.c [iso-8859-1] Fri Apr 24 17:37:31 2015
@@ -204,22 +204,9 @@
IN ULONG ValueLength, IN PVOID Context, IN PVOID
EntryContext)
{
NTSTATUS ret = STATUS_SUCCESS;
- int ValueNameLength = 0;
- LPSTR ValName = 0;
+
trace("**Test %d**\n", CurrentTest);
-
- 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");
+ trace("ValueName: %s\n", wine_dbgstr_w(ValueName));
switch(ValueType)
{
@@ -261,9 +248,6 @@
ok(!1, "Invalid Test Specified!\n");
CurrentTest++;
-
- if(ValName)
- pRtlFreeHeap(GetProcessHeap(), 0, ValName);
return ret;
}