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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
44 deletions
+24
-44
dbgchnl.c
programs/taskmgr/dbgchnl.c
+7
-7
perfdata.c
programs/taskmgr/perfdata.c
+13
-33
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)
static
int
list_channel_CB
(
HANDLE
hProcess
,
void
*
addr
,
struct
__wine_debug_channel
*
channel
,
void
*
user
)
{
int
j
;
char
val
[
2
];
WCHAR
val
[
2
];
LVITEMA
lvitem
;
int
index
;
HWND
hChannelLV
=
user
;
...
...
@@ -125,7 +125,7 @@ static int list_channel_CB(HANDLE hProcess, void* addr, struct __wine_debug_
for
(
j
=
0
;
j
<
4
;
j
++
)
{
val
[
0
]
=
(
channel
->
flags
&
(
1
<<
j
))
?
'x'
:
' '
;
ListView_SetItemText
(
hChannelLV
,
index
,
j
+
1
,
val
);
ListView_SetItemText
W
(
hChannelLV
,
index
,
j
+
1
,
val
);
}
return
1
;
}
...
...
@@ -290,13 +290,13 @@ static void DebugChannels_OnNotify(HWND hDlg, LPARAM lParam)
SendMessage
(
hChannelLV
,
LVM_SUBITEMHITTEST
,
0
,
(
LPARAM
)
&
lhti
);
if
(
nmia
->
iSubItem
>=
1
&&
nmia
->
iSubItem
<=
4
)
{
T
CHAR
val
[
2
];
TCHAR
name
[
32
];
W
CHAR
val
[
2
];
char
name
[
32
];
unsigned
bitmask
=
1
<<
(
lhti
.
iSubItem
-
1
);
struct
cce_user
user
;
ListView_GetItemText
(
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
A
(
hChannelLV
,
lhti
.
iItem
,
0
,
name
,
sizeof
(
name
)
/
sizeof
(
name
[
0
]));
ListView_GetItemText
W
(
hChannelLV
,
lhti
.
iItem
,
lhti
.
iSubItem
,
val
,
sizeof
(
val
)
/
sizeof
(
val
[
0
]));
user
.
name
=
name
;
user
.
value
=
(
val
[
0
]
==
'x'
)
?
0
:
bitmask
;
user
.
mask
=
bitmask
;
...
...
@@ -305,7 +305,7 @@ static void DebugChannels_OnNotify(HWND hDlg, LPARAM lParam)
if
(
user
.
done
)
{
val
[
0
]
^=
(
'x'
^
' '
);
ListView_SetItemText
(
hChannelLV
,
lhti
.
iItem
,
lhti
.
iSubItem
,
val
);
ListView_SetItemText
W
(
hChannelLV
,
lhti
.
iItem
,
lhti
.
iSubItem
,
val
);
}
if
(
user
.
notdone
)
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;
BOOL
PerfDataInitialize
(
void
)
{
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"
);
pGetGuiResources
=
(
PROCGGR
)
GetProcAddress
(
GetModuleHandle
(
_T
(
"user32.dll"
)
),
"GetGuiResources"
);
pGetProcessIoCounters
=
(
PROCGPIC
)
GetProcAddress
(
GetModuleHandle
(
_T
(
"kernel32.dll"
)
),
"GetProcessIoCounters"
);
NtQuerySystemInformation
=
(
PROCNTQSI
)
GetProcAddress
(
GetModuleHandle
W
(
wszNtdll
),
"NtQuerySystemInformation"
);
pGetGuiResources
=
(
PROCGGR
)
GetProcAddress
(
GetModuleHandle
W
(
wszUser32
),
"GetGuiResources"
);
pGetProcessIoCounters
=
(
PROCGPIC
)
GetProcAddress
(
GetModuleHandle
W
(
wszKernel32
),
"GetProcessIoCounters"
);
InitializeCriticalSection
(
&
PerfDataCriticalSection
);
...
...
@@ -92,7 +95,7 @@ void PerfDataRefresh(void)
ULONG
Idx
,
Idx2
;
HANDLE
hProcess
;
HANDLE
hProcessToken
;
TCHAR
szTemp
[
MAX_PATH
];
WCHAR
w
szTemp
[
MAX_PATH
];
DWORD
dwSize
;
SYSTEM_PERFORMANCE_INFORMATION
SysPerfInfo
;
SYSTEM_TIME_INFORMATION
SysTimeInfo
;
...
...
@@ -291,22 +294,9 @@ void PerfDataRefresh(void)
if
(
hProcess
)
{
if
(
OpenProcessToken
(
hProcess
,
TOKEN_QUERY
|
TOKEN_DUPLICATE
|
TOKEN_IMPERSONATE
,
&
hProcessToken
))
{
ImpersonateLoggedOnUser
(
hProcessToken
);
memset
(
szTemp
,
0
,
sizeof
(
TCHAR
[
MAX_PATH
]
));
memset
(
wszTemp
,
0
,
sizeof
(
wszTemp
));
dwSize
=
MAX_PATH
;
GetUserName
(
szTemp
,
&
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
GetUserNameW
(
wszTemp
,
&
dwSize
);
RevertToSelf
();
CloseHandle
(
hProcessToken
);
}
...
...
@@ -349,19 +339,14 @@ ULONG PerfDataGetProcessorSystemUsage(void)
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
;
EnterCriticalSection
(
&
PerfDataCriticalSection
);
if
(
Index
<
ProcessCount
)
{
#ifdef _UNICODE
wcsncpy
(
lpImageName
,
pPerfData
[
Index
].
ImageName
,
nMaxCount
);
#else
WideCharToMultiByte
(
CP_ACP
,
0
,
pPerfData
[
Index
].
ImageName
,
-
1
,
lpImageName
,
nMaxCount
,
NULL
,
NULL
);
#endif
wcsncpy
(
lpImageName
,
pPerfData
[
Index
].
ImageName
,
nMaxCount
);
bSuccessful
=
TRUE
;
}
else
{
bSuccessful
=
FALSE
;
...
...
@@ -386,19 +371,14 @@ ULONG PerfDataGetProcessId(ULONG Index)
return
ProcessId
;
}
BOOL
PerfDataGetUserName
(
ULONG
Index
,
LP
T
STR
lpUserName
,
int
nMaxCount
)
BOOL
PerfDataGetUserName
(
ULONG
Index
,
LP
W
STR
lpUserName
,
int
nMaxCount
)
{
BOOL
bSuccessful
;
EnterCriticalSection
(
&
PerfDataCriticalSection
);
if
(
Index
<
ProcessCount
)
{
#ifdef _UNICODE
wcsncpy
(
lpUserName
,
pPerfData
[
Index
].
UserName
,
nMaxCount
);
#else
WideCharToMultiByte
(
CP_ACP
,
0
,
pPerfData
[
Index
].
UserName
,
-
1
,
lpUserName
,
nMaxCount
,
NULL
,
NULL
);
#endif
wcsncpy
(
lpUserName
,
pPerfData
[
Index
].
UserName
,
nMaxCount
);
bSuccessful
=
TRUE
;
}
else
{
bSuccessful
=
FALSE
;
...
...
programs/taskmgr/perfdata.h
View file @
fc888d68
...
...
@@ -37,7 +37,6 @@ typedef struct _TIME {
typedef
ULARGE_INTEGER
TIME
,
*
PTIME
;
/* typedef WCHAR UNICODE_STRING; */
typedef
struct
_UNICODE_STRING
{
USHORT
Length
;
USHORT
MaximumLength
;
...
...
@@ -347,9 +346,9 @@ ULONG PerfDataGetProcessCount(void);
ULONG
PerfDataGetProcessorUsage
(
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
);
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
PerfDataGetCPUUsage
(
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)
HMODULE
hShell32
;
RUNFILEDLG
RunFileDlg
;
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
));
/* 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