spi.pszProcessName should be UNICODE_STRING

Felix Nawothnig felix.nawothnig at t-online.de
Mon Jun 6 05:15:07 CDT 2005


This lets the taskname appear in WinXP's taskmgr.exe.

ChangeLog:
Make SYSTEM_THREAD_INFORMATION.pszProcessName an UNICODE_STRING
-------------- next part --------------
Index: nt.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/nt.c,v
retrieving revision 1.84
diff -u -r1.84 nt.c
--- nt.c	3 Jun 2005 11:24:44 -0000	1.84
+++ nt.c	6 Jun 2005 10:11:44 -0000
@@ -727,6 +727,7 @@
                 }
                 if (Length >= len + wlen + spi->dwThreadCount * sizeof(SYSTEM_THREAD_INFORMATION))
                 {
+                    PWSTR   pszProcessName;
                     int     i, j;
 
                     /* set thread info */
@@ -760,9 +761,10 @@
                     if (ret == STATUS_NO_MORE_FILES) ret = STATUS_SUCCESS;
 
                     /* now append process name */
-                    spi->pszProcessName = (WCHAR*)((char*)spi + spi->dwOffset);
-                    memcpy( spi->pszProcessName, procname, wlen - sizeof(WCHAR) );
-                    spi->pszProcessName[wlen / sizeof(WCHAR)] = 0;
+                    pszProcessName = (WCHAR*)((char*)spi + spi->dwOffset);
+                    memcpy( pszProcessName, procname, wlen - sizeof(WCHAR) );
+                    pszProcessName[wlen / sizeof(WCHAR)] = 0;
+                    RtlInitUnicodeString(&spi->ProcessName, pszProcessName);
                     len += wlen;
                     spi->dwOffset += wlen;
 
Index: ../../include/winternl.h
===================================================================
RCS file: /home/wine/wine/include/winternl.h,v
retrieving revision 1.129
diff -u -r1.129 winternl.h
--- ../../include/winternl.h	3 Jun 2005 11:24:43 -0000	1.129
+++ ../../include/winternl.h	6 Jun 2005 10:11:47 -0000
@@ -1082,8 +1082,7 @@
     FILETIME ftCreationTime;
     FILETIME ftUserTime;
     FILETIME ftKernelTime;
-    DWORD dwUnknown2;
-    WCHAR *pszProcessName;
+    UNICODE_STRING ProcessName;
     DWORD dwBasePriority;
     DWORD dwProcessID;
     DWORD dwParentProcessID;


More information about the wine-patches mailing list