Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fc888d68
Commit
fc888d68
authored
Aug 24, 2009
by
Dylan Smith
Committed by
Alexandre Julliard
Aug 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskmgr: Finish partial unicode conversion of process page.
parent
a0449a5f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
42 deletions
+22
-42
dbgchnl.c
programs/taskmgr/dbgchnl.c
+7
-7
perfdata.c
programs/taskmgr/perfdata.c
+11
-31
perfdata.h
programs/taskmgr/perfdata.h
+2
-3
procpage.c
programs/taskmgr/procpage.c
+0
-0
run.c
programs/taskmgr/run.c
+2
-1
No files found.
programs/taskmgr/dbgchnl.c
View file @
fc888d68
...
@@ -108,7 +108,7 @@ static DWORD get_selected_pid(void)
...
@@ -108,7 +108,7 @@ static DWORD get_selected_pid(void)
static
int
list_channel_CB
(
HANDLE
hProcess
,
void
*
addr
,
struct
__wine_debug_channel
*
channel
,
void
*
user
)
static
int
list_channel_CB
(
HANDLE
hProcess
,
void
*
addr
,
struct
__wine_debug_channel
*
channel
,
void
*
user
)
{
{
int
j
;
int
j
;
char
val
[
2
];
WCHAR
val
[
2
];
LVITEMA
lvitem
;
LVITEMA
lvitem
;
int
index
;
int
index
;
HWND
hChannelLV
=
user
;
HWND
hChannelLV
=
user
;
...
@@ -125,7 +125,7 @@ static int list_channel_CB(HANDLE hProcess, void* addr, struct __wine_debug_
...
@@ -125,7 +125,7 @@ static int list_channel_CB(HANDLE hProcess, void* addr, struct __wine_debug_
for
(
j
=
0
;
j
<
4
;
j
++
)
for
(
j
=
0
;
j
<
4
;
j
++
)
{
{
val
[
0
]
=
(
channel
->
flags
&
(
1
<<
j
))
?
'x'
:
' '
;
val
[
0
]
=
(
channel
->
flags
&
(
1
<<
j
))
?
'x'
:
' '
;
ListView_SetItemText
(
hChannelLV
,
index
,
j
+
1
,
val
);
ListView_SetItemText
W
(
hChannelLV
,
index
,
j
+
1
,
val
);
}
}
return
1
;
return
1
;
}
}
...
@@ -290,13 +290,13 @@ static void DebugChannels_OnNotify(HWND hDlg, LPARAM lParam)
...
@@ -290,13 +290,13 @@ static void DebugChannels_OnNotify(HWND hDlg, LPARAM lParam)
SendMessage
(
hChannelLV
,
LVM_SUBITEMHITTEST
,
0
,
(
LPARAM
)
&
lhti
);
SendMessage
(
hChannelLV
,
LVM_SUBITEMHITTEST
,
0
,
(
LPARAM
)
&
lhti
);
if
(
nmia
->
iSubItem
>=
1
&&
nmia
->
iSubItem
<=
4
)
if
(
nmia
->
iSubItem
>=
1
&&
nmia
->
iSubItem
<=
4
)
{
{
T
CHAR
val
[
2
];
W
CHAR
val
[
2
];
TCHAR
name
[
32
];
char
name
[
32
];
unsigned
bitmask
=
1
<<
(
lhti
.
iSubItem
-
1
);
unsigned
bitmask
=
1
<<
(
lhti
.
iSubItem
-
1
);
struct
cce_user
user
;
struct
cce_user
user
;
ListView_GetItemText
(
hChannelLV
,
lhti
.
iItem
,
0
,
name
,
sizeof
(
name
)
/
sizeof
(
name
[
0
]));
ListView_GetItemText
A
(
hChannelLV
,
lhti
.
iItem
,
0
,
name
,
sizeof
(
name
)
/
sizeof
(
name
[
0
]));
ListView_GetItemText
(
hChannelLV
,
lhti
.
iItem
,
lhti
.
iSubItem
,
val
,
sizeof
(
val
)
/
sizeof
(
val
[
0
]));
ListView_GetItemText
W
(
hChannelLV
,
lhti
.
iItem
,
lhti
.
iSubItem
,
val
,
sizeof
(
val
)
/
sizeof
(
val
[
0
]));
user
.
name
=
name
;
user
.
name
=
name
;
user
.
value
=
(
val
[
0
]
==
'x'
)
?
0
:
bitmask
;
user
.
value
=
(
val
[
0
]
==
'x'
)
?
0
:
bitmask
;
user
.
mask
=
bitmask
;
user
.
mask
=
bitmask
;
...
@@ -305,7 +305,7 @@ static void DebugChannels_OnNotify(HWND hDlg, LPARAM lParam)
...
@@ -305,7 +305,7 @@ static void DebugChannels_OnNotify(HWND hDlg, LPARAM lParam)
if
(
user
.
done
)
if
(
user
.
done
)
{
{
val
[
0
]
^=
(
'x'
^
' '
);
val
[
0
]
^=
(
'x'
^
' '
);
ListView_SetItemText
(
hChannelLV
,
lhti
.
iItem
,
lhti
.
iSubItem
,
val
);
ListView_SetItemText
W
(
hChannelLV
,
lhti
.
iItem
,
lhti
.
iSubItem
,
val
);
}
}
if
(
user
.
notdone
)
if
(
user
.
notdone
)
printf
(
"Some channel instances weren't correctly set
\n
"
);
printf
(
"Some channel instances weren't correctly set
\n
"
);
...
...
programs/taskmgr/perfdata.c
View file @
fc888d68
...
@@ -54,10 +54,13 @@ static PSYSTEM_PROCESSORTIME_INFO SystemProcessorTimeInfo = NULL;
...
@@ -54,10 +54,13 @@ static PSYSTEM_PROCESSORTIME_INFO SystemProcessorTimeInfo = NULL;
BOOL
PerfDataInitialize
(
void
)
BOOL
PerfDataInitialize
(
void
)
{
{
LONG
status
;
LONG
status
;
static
const
WCHAR
wszNtdll
[]
=
{
'n'
,
't'
,
'd'
,
'l'
,
'l'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
wszUser32
[]
=
{
'u'
,
's'
,
'e'
,
'r'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
wszKernel32
[]
=
{
'k'
,
'e'
,
'r'
,
'n'
,
'e'
,
'l'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
NtQuerySystemInformation
=
(
PROCNTQSI
)
GetProcAddress
(
GetModuleHandle
(
_T
(
"ntdll.dll"
)
),
"NtQuerySystemInformation"
);
NtQuerySystemInformation
=
(
PROCNTQSI
)
GetProcAddress
(
GetModuleHandle
W
(
wszNtdll
),
"NtQuerySystemInformation"
);
pGetGuiResources
=
(
PROCGGR
)
GetProcAddress
(
GetModuleHandle
(
_T
(
"user32.dll"
)
),
"GetGuiResources"
);
pGetGuiResources
=
(
PROCGGR
)
GetProcAddress
(
GetModuleHandle
W
(
wszUser32
),
"GetGuiResources"
);
pGetProcessIoCounters
=
(
PROCGPIC
)
GetProcAddress
(
GetModuleHandle
(
_T
(
"kernel32.dll"
)
),
"GetProcessIoCounters"
);
pGetProcessIoCounters
=
(
PROCGPIC
)
GetProcAddress
(
GetModuleHandle
W
(
wszKernel32
),
"GetProcessIoCounters"
);
InitializeCriticalSection
(
&
PerfDataCriticalSection
);
InitializeCriticalSection
(
&
PerfDataCriticalSection
);
...
@@ -92,7 +95,7 @@ void PerfDataRefresh(void)
...
@@ -92,7 +95,7 @@ void PerfDataRefresh(void)
ULONG
Idx
,
Idx2
;
ULONG
Idx
,
Idx2
;
HANDLE
hProcess
;
HANDLE
hProcess
;
HANDLE
hProcessToken
;
HANDLE
hProcessToken
;
TCHAR
szTemp
[
MAX_PATH
];
WCHAR
w
szTemp
[
MAX_PATH
];
DWORD
dwSize
;
DWORD
dwSize
;
SYSTEM_PERFORMANCE_INFORMATION
SysPerfInfo
;
SYSTEM_PERFORMANCE_INFORMATION
SysPerfInfo
;
SYSTEM_TIME_INFORMATION
SysTimeInfo
;
SYSTEM_TIME_INFORMATION
SysTimeInfo
;
...
@@ -291,22 +294,9 @@ void PerfDataRefresh(void)
...
@@ -291,22 +294,9 @@ void PerfDataRefresh(void)
if
(
hProcess
)
{
if
(
hProcess
)
{
if
(
OpenProcessToken
(
hProcess
,
TOKEN_QUERY
|
TOKEN_DUPLICATE
|
TOKEN_IMPERSONATE
,
&
hProcessToken
))
{
if
(
OpenProcessToken
(
hProcess
,
TOKEN_QUERY
|
TOKEN_DUPLICATE
|
TOKEN_IMPERSONATE
,
&
hProcessToken
))
{
ImpersonateLoggedOnUser
(
hProcessToken
);
ImpersonateLoggedOnUser
(
hProcessToken
);
memset
(
szTemp
,
0
,
sizeof
(
TCHAR
[
MAX_PATH
]
));
memset
(
wszTemp
,
0
,
sizeof
(
wszTemp
));
dwSize
=
MAX_PATH
;
dwSize
=
MAX_PATH
;
GetUserName
(
szTemp
,
&
dwSize
);
GetUserNameW
(
wszTemp
,
&
dwSize
);
#ifndef UNICODE
MultiByteToWideChar
(
CP_ACP
,
MB_PRECOMPOSED
,
szTemp
,
-
1
,
pPerfData
[
Idx
].
UserName
,
MAX_PATH
);
/*
int MultiByteToWideChar(
UINT CodePage, // code page
DWORD dwFlags, // character-type options
LPCSTR lpMultiByteStr, // string to map
int cbMultiByte, // number of bytes in string
LPWSTR lpWideCharStr, // wide-character buffer
int cchWideChar // size of buffer
);
*/
#endif
RevertToSelf
();
RevertToSelf
();
CloseHandle
(
hProcessToken
);
CloseHandle
(
hProcessToken
);
}
}
...
@@ -349,19 +339,14 @@ ULONG PerfDataGetProcessorSystemUsage(void)
...
@@ -349,19 +339,14 @@ ULONG PerfDataGetProcessorSystemUsage(void)
return
(
ULONG
)
dbKernelTime
;
return
(
ULONG
)
dbKernelTime
;
}
}
BOOL
PerfDataGetImageName
(
ULONG
Index
,
LP
T
STR
lpImageName
,
int
nMaxCount
)
BOOL
PerfDataGetImageName
(
ULONG
Index
,
LP
W
STR
lpImageName
,
int
nMaxCount
)
{
{
BOOL
bSuccessful
;
BOOL
bSuccessful
;
EnterCriticalSection
(
&
PerfDataCriticalSection
);
EnterCriticalSection
(
&
PerfDataCriticalSection
);
if
(
Index
<
ProcessCount
)
{
if
(
Index
<
ProcessCount
)
{
#ifdef _UNICODE
wcsncpy
(
lpImageName
,
pPerfData
[
Index
].
ImageName
,
nMaxCount
);
wcsncpy
(
lpImageName
,
pPerfData
[
Index
].
ImageName
,
nMaxCount
);
#else
WideCharToMultiByte
(
CP_ACP
,
0
,
pPerfData
[
Index
].
ImageName
,
-
1
,
lpImageName
,
nMaxCount
,
NULL
,
NULL
);
#endif
bSuccessful
=
TRUE
;
bSuccessful
=
TRUE
;
}
else
{
}
else
{
bSuccessful
=
FALSE
;
bSuccessful
=
FALSE
;
...
@@ -386,19 +371,14 @@ ULONG PerfDataGetProcessId(ULONG Index)
...
@@ -386,19 +371,14 @@ ULONG PerfDataGetProcessId(ULONG Index)
return
ProcessId
;
return
ProcessId
;
}
}
BOOL
PerfDataGetUserName
(
ULONG
Index
,
LP
T
STR
lpUserName
,
int
nMaxCount
)
BOOL
PerfDataGetUserName
(
ULONG
Index
,
LP
W
STR
lpUserName
,
int
nMaxCount
)
{
{
BOOL
bSuccessful
;
BOOL
bSuccessful
;
EnterCriticalSection
(
&
PerfDataCriticalSection
);
EnterCriticalSection
(
&
PerfDataCriticalSection
);
if
(
Index
<
ProcessCount
)
{
if
(
Index
<
ProcessCount
)
{
#ifdef _UNICODE
wcsncpy
(
lpUserName
,
pPerfData
[
Index
].
UserName
,
nMaxCount
);
wcsncpy
(
lpUserName
,
pPerfData
[
Index
].
UserName
,
nMaxCount
);
#else
WideCharToMultiByte
(
CP_ACP
,
0
,
pPerfData
[
Index
].
UserName
,
-
1
,
lpUserName
,
nMaxCount
,
NULL
,
NULL
);
#endif
bSuccessful
=
TRUE
;
bSuccessful
=
TRUE
;
}
else
{
}
else
{
bSuccessful
=
FALSE
;
bSuccessful
=
FALSE
;
...
...
programs/taskmgr/perfdata.h
View file @
fc888d68
...
@@ -37,7 +37,6 @@ typedef struct _TIME {
...
@@ -37,7 +37,6 @@ typedef struct _TIME {
typedef
ULARGE_INTEGER
TIME
,
*
PTIME
;
typedef
ULARGE_INTEGER
TIME
,
*
PTIME
;
/* typedef WCHAR UNICODE_STRING; */
typedef
struct
_UNICODE_STRING
{
typedef
struct
_UNICODE_STRING
{
USHORT
Length
;
USHORT
Length
;
USHORT
MaximumLength
;
USHORT
MaximumLength
;
...
@@ -347,9 +346,9 @@ ULONG PerfDataGetProcessCount(void);
...
@@ -347,9 +346,9 @@ ULONG PerfDataGetProcessCount(void);
ULONG
PerfDataGetProcessorUsage
(
void
);
ULONG
PerfDataGetProcessorUsage
(
void
);
ULONG
PerfDataGetProcessorSystemUsage
(
void
);
ULONG
PerfDataGetProcessorSystemUsage
(
void
);
BOOL
PerfDataGetImageName
(
ULONG
Index
,
LP
T
STR
lpImageName
,
int
nMaxCount
);
BOOL
PerfDataGetImageName
(
ULONG
Index
,
LP
W
STR
lpImageName
,
int
nMaxCount
);
ULONG
PerfDataGetProcessId
(
ULONG
Index
);
ULONG
PerfDataGetProcessId
(
ULONG
Index
);
BOOL
PerfDataGetUserName
(
ULONG
Index
,
LP
T
STR
lpUserName
,
int
nMaxCount
);
BOOL
PerfDataGetUserName
(
ULONG
Index
,
LP
W
STR
lpUserName
,
int
nMaxCount
);
ULONG
PerfDataGetSessionId
(
ULONG
Index
);
ULONG
PerfDataGetSessionId
(
ULONG
Index
);
ULONG
PerfDataGetCPUUsage
(
ULONG
Index
);
ULONG
PerfDataGetCPUUsage
(
ULONG
Index
);
TIME
PerfDataGetCPUTime
(
ULONG
Index
);
TIME
PerfDataGetCPUTime
(
ULONG
Index
);
...
...
programs/taskmgr/procpage.c
View file @
fc888d68
This diff is collapsed.
Click to expand it.
programs/taskmgr/run.c
View file @
fc888d68
...
@@ -53,8 +53,9 @@ void TaskManager_OnFileNew(void)
...
@@ -53,8 +53,9 @@ void TaskManager_OnFileNew(void)
HMODULE
hShell32
;
HMODULE
hShell32
;
RUNFILEDLG
RunFileDlg
;
RUNFILEDLG
RunFileDlg
;
OSVERSIONINFO
versionInfo
;
OSVERSIONINFO
versionInfo
;
static
const
WCHAR
wszShell32
[]
=
{
'S'
,
'H'
,
'E'
,
'L'
,
'L'
,
'3'
,
'2'
,
'.'
,
'D'
,
'L'
,
'L'
,
0
};
hShell32
=
LoadLibrary
(
_T
(
"SHELL32.DLL"
)
);
hShell32
=
LoadLibrary
W
(
wszShell32
);
RunFileDlg
=
(
RUNFILEDLG
)(
FARPROC
)
GetProcAddress
(
hShell32
,
(
char
*
)((
long
)
0x3D
));
RunFileDlg
=
(
RUNFILEDLG
)(
FARPROC
)
GetProcAddress
(
hShell32
,
(
char
*
)((
long
)
0x3D
));
/* Show "Run..." dialog */
/* Show "Run..." dialog */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment