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
5ad25c29
Commit
5ad25c29
authored
Sep 21, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use wide character string literals.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9cc92365
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
133 additions
and
249 deletions
+133
-249
button.c
dlls/user32/button.c
+1
-2
class.c
dlls/user32/class.c
+27
-28
combo.c
dlls/user32/combo.c
+7
-18
dde_client.c
dlls/user32/dde_client.c
+1
-1
dde_misc.c
dlls/user32/dde_misc.c
+2
-3
dde_server.c
dlls/user32/dde_server.c
+3
-7
defwnd.c
dlls/user32/defwnd.c
+1
-2
desktop.c
dlls/user32/desktop.c
+3
-9
dialog.c
dlls/user32/dialog.c
+9
-9
driver.c
dlls/user32/driver.c
+7
-19
edit.c
dlls/user32/edit.c
+3
-6
icontitle.c
dlls/user32/icontitle.c
+1
-2
listbox.c
dlls/user32/listbox.c
+7
-12
mdi.c
dlls/user32/mdi.c
+3
-7
menu.c
dlls/user32/menu.c
+2
-6
message.c
dlls/user32/message.c
+1
-3
misc.c
dlls/user32/misc.c
+2
-4
msgbox.c
dlls/user32/msgbox.c
+2
-4
painting.c
dlls/user32/painting.c
+1
-3
rawinput.c
dlls/user32/rawinput.c
+4
-6
scroll.c
dlls/user32/scroll.c
+1
-2
spy.c
dlls/user32/spy.c
+1
-4
static.c
dlls/user32/static.c
+1
-2
sysparams.c
dlls/user32/sysparams.c
+0
-0
text.c
dlls/user32/text.c
+1
-1
uitools.c
dlls/user32/uitools.c
+1
-2
user_main.c
dlls/user32/user_main.c
+27
-56
win.c
dlls/user32/win.c
+8
-16
winstation.c
dlls/user32/winstation.c
+4
-10
wsprintf.c
dlls/user32/wsprintf.c
+2
-5
No files found.
dlls/user32/button.c
View file @
5ad25c29
...
...
@@ -121,10 +121,9 @@ static const pfPaint btnPaintFunc[MAX_BTN_TYPE] =
/*********************************************************************
* button class descriptor
*/
static
const
WCHAR
buttonW
[]
=
{
'B'
,
'u'
,
't'
,
't'
,
'o'
,
'n'
,
0
};
const
struct
builtin_class_descr
BUTTON_builtin_class
=
{
buttonW
,
/* name */
L"Button"
,
/* name */
CS_DBLCLKS
|
CS_VREDRAW
|
CS_HREDRAW
|
CS_PARENTDC
,
/* style */
WINPROC_BUTTON
,
/* proc */
NB_EXTRA_BYTES
,
/* extra */
...
...
dlls/user32/class.c
View file @
5ad25c29
...
...
@@ -123,28 +123,28 @@ ATOM get_int_atom_value( LPCWSTR name )
*/
static
BOOL
is_comctl32_class
(
const
WCHAR
*
name
)
{
static
const
WCHAR
classesW
[][
20
]
=
static
const
WCHAR
*
classesW
[
]
=
{
{
'C'
,
'o'
,
'm'
,
'b'
,
'o'
,
'B'
,
'o'
,
'x'
,
'E'
,
'x'
,
'3'
,
'2'
,
0
}
,
{
'm'
,
's'
,
'c'
,
't'
,
'l'
,
's'
,
'_'
,
'h'
,
'o'
,
't'
,
'k'
,
'e'
,
'y'
,
'3'
,
'2'
,
0
}
,
{
'm'
,
's'
,
'c'
,
't'
,
'l'
,
's'
,
'_'
,
'p'
,
'r'
,
'o'
,
'g'
,
'r'
,
'e'
,
's'
,
's'
,
'3'
,
'2'
,
0
}
,
{
'm'
,
's'
,
'c'
,
't'
,
'l'
,
's'
,
'_'
,
's'
,
't'
,
'a'
,
't'
,
'u'
,
's'
,
'b'
,
'a'
,
'r'
,
'3'
,
'2'
,
0
}
,
{
'm'
,
's'
,
'c'
,
't'
,
'l'
,
's'
,
'_'
,
't'
,
'r'
,
'a'
,
'c'
,
'k'
,
'b'
,
'a'
,
'r'
,
'3'
,
'2'
,
0
}
,
{
'm'
,
's'
,
'c'
,
't'
,
'l'
,
's'
,
'_'
,
'u'
,
'p'
,
'd'
,
'o'
,
'w'
,
'n'
,
'3'
,
'2'
,
0
}
,
{
'N'
,
'a'
,
't'
,
'i'
,
'v'
,
'e'
,
'F'
,
'o'
,
'n'
,
't'
,
'C'
,
't'
,
'l'
,
0
}
,
{
'R'
,
'e'
,
'B'
,
'a'
,
'r'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
'3'
,
'2'
,
0
}
,
{
'S'
,
'y'
,
's'
,
'A'
,
'n'
,
'i'
,
'm'
,
'a'
,
't'
,
'e'
,
'3'
,
'2'
,
0
}
,
{
'S'
,
'y'
,
's'
,
'D'
,
'a'
,
't'
,
'e'
,
'T'
,
'i'
,
'm'
,
'e'
,
'P'
,
'i'
,
'c'
,
'k'
,
'3'
,
'2'
,
0
}
,
{
'S'
,
'y'
,
's'
,
'H'
,
'e'
,
'a'
,
'd'
,
'e'
,
'r'
,
'3'
,
'2'
,
0
}
,
{
'S'
,
'y'
,
's'
,
'I'
,
'P'
,
'A'
,
'd'
,
'd'
,
'r'
,
'e'
,
's'
,
's'
,
'3'
,
'2'
,
0
}
,
{
'S'
,
'y'
,
's'
,
'L'
,
'i'
,
'n'
,
'k'
,
0
}
,
{
'S'
,
'y'
,
's'
,
'L'
,
'i'
,
's'
,
't'
,
'V'
,
'i'
,
'e'
,
'w'
,
'3'
,
'2'
,
0
}
,
{
'S'
,
'y'
,
's'
,
'M'
,
'o'
,
'n'
,
't'
,
'h'
,
'C'
,
'a'
,
'l'
,
'3'
,
'2'
,
0
}
,
{
'S'
,
'y'
,
's'
,
'P'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
}
,
{
'S'
,
'y'
,
's'
,
'T'
,
'a'
,
'b'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'3'
,
'2'
,
0
}
,
{
'S'
,
'y'
,
's'
,
'T'
,
'r'
,
'e'
,
'e'
,
'V'
,
'i'
,
'e'
,
'w'
,
'3'
,
'2'
,
0
}
,
{
'T'
,
'o'
,
'o'
,
'l'
,
'b'
,
'a'
,
'r'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
'3'
,
'2'
,
0
}
,
{
't'
,
'o'
,
'o'
,
'l'
,
't'
,
'i'
,
'p'
,
's'
,
'_'
,
'c'
,
'l'
,
'a'
,
's'
,
's'
,
'3'
,
'2'
,
0
}
,
L"ComboBoxEx32"
,
L"msctls_hotkey32"
,
L"msctls_progress32"
,
L"msctls_statusbar32"
,
L"msctls_trackbar32"
,
L"msctls_updown32"
,
L"NativeFontCtl"
,
L"ReBarWindow32"
,
L"SysAnimate32"
,
L"SysDateTimePick32"
,
L"SysHeader32"
,
L"SysIPAddress32"
,
L"SysLink"
,
L"SysListView32"
,
L"SysMonthCal32"
,
L"SysPager"
,
L"SysTabControl32"
,
L"SysTreeView32"
,
L"ToolbarWindow32"
,
L"tooltips_class32"
,
};
int
min
=
0
,
max
=
ARRAY_SIZE
(
classesW
)
-
1
;
...
...
@@ -161,11 +161,11 @@ static BOOL is_comctl32_class( const WCHAR *name )
static
BOOL
is_builtin_class
(
const
WCHAR
*
name
)
{
static
const
WCHAR
classesW
[][
20
]
=
static
const
WCHAR
*
classesW
[
]
=
{
{
'I'
,
'M'
,
'E'
,
0
}
,
{
'M'
,
'D'
,
'I'
,
'C'
,
'l'
,
'i'
,
'e'
,
'n'
,
't'
,
0
}
,
{
'S'
,
'c'
,
'r'
,
'o'
,
'l'
,
'l'
,
'b'
,
'a'
,
'r'
,
0
}
,
L"IME"
,
L"MDIClient"
,
L"Scrollbar"
,
};
int
min
=
0
,
max
=
ARRAY_SIZE
(
classesW
)
-
1
;
...
...
@@ -408,7 +408,6 @@ const WCHAR *CLASS_GetVersionedName( const WCHAR *name, UINT *basename_offset, W
*/
static
CLASS
*
CLASS_FindClass
(
LPCWSTR
name
,
HINSTANCE
hinstance
)
{
static
const
WCHAR
comctl32W
[]
=
{
'c'
,
'o'
,
'm'
,
'c'
,
't'
,
'l'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
struct
list
*
ptr
;
ATOM
atom
=
get_int_atom_value
(
name
);
...
...
@@ -443,8 +442,8 @@ static CLASS *CLASS_FindClass( LPCWSTR name, HINSTANCE hinstance )
if
(
atom
)
break
;
if
(
!
is_comctl32_class
(
name
))
break
;
if
(
GetModuleHandleW
(
comctl32W
))
break
;
if
(
!
LoadLibraryW
(
comctl32W
))
break
;
if
(
GetModuleHandleW
(
L"comctl32.dll"
))
break
;
if
(
!
LoadLibraryW
(
L"comctl32.dll"
))
break
;
TRACE
(
"%s retrying after loading comctl32
\n
"
,
debugstr_w
(
name
)
);
}
...
...
dlls/user32/combo.c
View file @
5ad25c29
...
...
@@ -80,10 +80,9 @@ static void CBResetPos(HEADCOMBO *combo, BOOL redraw);
/*********************************************************************
* combo class descriptor
*/
static
const
WCHAR
comboboxW
[]
=
{
'C'
,
'o'
,
'm'
,
'b'
,
'o'
,
'B'
,
'o'
,
'x'
,
0
};
const
struct
builtin_class_descr
COMBO_builtin_class
=
{
comboboxW
,
/* name */
L"ComboBox"
,
/* name */
CS_PARENTDC
|
CS_DBLCLKS
|
CS_HREDRAW
|
CS_VREDRAW
,
/* style */
WINPROC_COMBO
,
/* proc */
sizeof
(
HEADCOMBO
*
),
/* extra */
...
...
@@ -412,9 +411,6 @@ static void CBGetDroppedControlRect( LPHEADCOMBO lphc, LPRECT lpRect)
static
LRESULT
COMBO_Create
(
HWND
hwnd
,
LPHEADCOMBO
lphc
,
HWND
hwndParent
,
LONG
style
,
BOOL
unicode
)
{
static
const
WCHAR
clbName
[]
=
{
'C'
,
'o'
,
'm'
,
'b'
,
'o'
,
'L'
,
'B'
,
'o'
,
'x'
,
0
};
static
const
WCHAR
editName
[]
=
{
'E'
,
'd'
,
'i'
,
't'
,
0
};
if
(
!
CB_GETTYPE
(
lphc
)
)
lphc
->
dwStyle
|=
CBS_SIMPLE
;
if
(
CB_GETTYPE
(
lphc
)
!=
CBS_DROPDOWNLIST
)
lphc
->
wState
|=
CBF_EDIT
;
...
...
@@ -495,7 +491,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
}
if
(
unicode
)
lphc
->
hWndLBox
=
CreateWindowExW
(
lbeExStyle
,
clbName
,
NULL
,
lbeStyle
,
lphc
->
hWndLBox
=
CreateWindowExW
(
lbeExStyle
,
L"ComboLBox"
,
NULL
,
lbeStyle
,
lphc
->
droppedRect
.
left
,
lphc
->
droppedRect
.
top
,
lphc
->
droppedRect
.
right
-
lphc
->
droppedRect
.
left
,
...
...
@@ -530,7 +526,7 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG
if
(
!
IsWindowEnabled
(
hwnd
))
lbeStyle
|=
WS_DISABLED
;
if
(
unicode
)
lphc
->
hWndEdit
=
CreateWindowExW
(
0
,
editName
,
NULL
,
lbeStyle
,
lphc
->
hWndEdit
=
CreateWindowExW
(
0
,
L"Edit"
,
NULL
,
lbeStyle
,
lphc
->
textRect
.
left
,
lphc
->
textRect
.
top
,
lphc
->
textRect
.
right
-
lphc
->
textRect
.
left
,
lphc
->
textRect
.
bottom
-
lphc
->
textRect
.
top
,
...
...
@@ -678,8 +674,7 @@ static void CBPaintText(
if
(
lphc
->
wState
&
CBF_EDIT
)
{
static
const
WCHAR
empty_stringW
[]
=
{
0
};
if
(
CB_HASSTRINGS
(
lphc
)
)
SetWindowTextW
(
lphc
->
hWndEdit
,
pText
?
pText
:
empty_stringW
);
if
(
CB_HASSTRINGS
(
lphc
)
)
SetWindowTextW
(
lphc
->
hWndEdit
,
pText
?
pText
:
L""
);
if
(
lphc
->
wState
&
CBF_FOCUSED
)
SendMessageW
(
lphc
->
hWndEdit
,
EM_SETSEL
,
0
,
MAXLONG
);
}
...
...
@@ -735,8 +730,6 @@ static void CBPaintText(
}
else
{
static
const
WCHAR
empty_stringW
[]
=
{
0
};
if
(
(
lphc
->
wState
&
CBF_FOCUSED
)
&&
!
(
lphc
->
wState
&
CBF_DROPPED
)
)
{
...
...
@@ -751,7 +744,7 @@ static void CBPaintText(
rectEdit
.
top
+
1
,
ETO_OPAQUE
|
ETO_CLIPPED
,
&
rectEdit
,
pText
?
pText
:
empty_stringW
,
size
,
NULL
);
pText
?
pText
:
L""
,
size
,
NULL
);
if
(
lphc
->
wState
&
CBF_FOCUSED
&&
!
(
lphc
->
wState
&
CBF_DROPPED
))
DrawFocusRect
(
hdc
,
&
rectEdit
);
...
...
@@ -890,7 +883,6 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
{
INT
length
;
LPWSTR
pText
=
NULL
;
static
const
WCHAR
empty_stringW
[]
=
{
0
};
TRACE
(
"
\t
%i
\n
"
,
index
);
...
...
@@ -909,7 +901,7 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
if
(
CB_HASSTRINGS
(
lphc
)
)
{
lphc
->
wState
|=
(
CBF_NOEDITNOTIFY
|
CBF_NOLBSELECT
);
SendMessageW
(
lphc
->
hWndEdit
,
WM_SETTEXT
,
0
,
pText
?
(
LPARAM
)
pText
:
(
LPARAM
)
empty_stringW
);
SendMessageW
(
lphc
->
hWndEdit
,
WM_SETTEXT
,
0
,
pText
?
(
LPARAM
)
pText
:
(
LPARAM
)
L""
);
lphc
->
wState
&=
~
(
CBF_NOEDITNOTIFY
|
CBF_NOLBSELECT
);
}
...
...
@@ -2012,10 +2004,7 @@ LRESULT ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
case
CB_RESETCONTENT
:
SendMessageW
(
lphc
->
hWndLBox
,
LB_RESETCONTENT
,
0
,
0
);
if
(
(
lphc
->
wState
&
CBF_EDIT
)
&&
CB_HASSTRINGS
(
lphc
)
)
{
static
const
WCHAR
empty_stringW
[]
=
{
0
};
SendMessageW
(
lphc
->
hWndEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
empty_stringW
);
}
SendMessageW
(
lphc
->
hWndEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
L""
);
else
InvalidateRect
(
lphc
->
self
,
NULL
,
TRUE
);
return
TRUE
;
...
...
dlls/user32/dde_client.c
View file @
5ad25c29
...
...
@@ -40,7 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddeml);
static
LRESULT
CALLBACK
WDML_ClientProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
/* only for one client, not conv list */
const
char
WDML_szClientConvClassA
[]
=
"WineDdeClientA"
;
const
WCHAR
WDML_szClientConvClassW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'D'
,
'd'
,
'e'
,
'C'
,
'l'
,
'i'
,
'e'
,
'n'
,
't'
,
'W'
,
0
}
;
const
WCHAR
WDML_szClientConvClassW
[]
=
L"WineDdeClientW"
;
/******************************************************************************
* DdeConnectList [USER32.@] Establishes conversation with DDE servers
...
...
dlls/user32/dde_misc.c
View file @
5ad25c29
...
...
@@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddeml);
static
WDML_INSTANCE
*
WDML_InstanceList
=
NULL
;
static
LONG
WDML_MaxInstanceID
=
0
;
/* OK for present, have to worry about wrap-around later */
const
WCHAR
WDML_szEventClass
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'D'
,
'd'
,
'e'
,
'E'
,
'v'
,
'e'
,
'n'
,
't'
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
0
}
;
const
WCHAR
WDML_szEventClass
[]
=
L"WineDdeEventClass"
;
/* protection for instance list */
static
CRITICAL_SECTION
WDML_CritSect
;
...
...
@@ -1646,7 +1646,6 @@ HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease,
*/
WDML_SERVER
*
WDML_AddServer
(
WDML_INSTANCE
*
pInstance
,
HSZ
hszService
,
HSZ
hszTopic
)
{
static
const
WCHAR
fmtW
[]
=
{
'%'
,
's'
,
'('
,
'0'
,
'x'
,
'%'
,
'*'
,
'x'
,
')'
,
0
};
WDML_SERVER
*
pServer
;
WCHAR
buf1
[
256
];
WCHAR
buf2
[
256
];
...
...
@@ -1658,7 +1657,7 @@ WDML_SERVER* WDML_AddServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTop
WDML_IncHSZ
(
pInstance
,
hszService
);
DdeQueryStringW
(
pInstance
->
instanceID
,
hszService
,
buf1
,
256
,
CP_WINUNICODE
);
swprintf
(
buf2
,
256
,
fmtW
,
buf1
,
2
*
sizeof
(
ULONG_PTR
),
GetCurrentProcessId
());
swprintf
(
buf2
,
256
,
L"%s(0x%*x)"
,
buf1
,
2
*
sizeof
(
ULONG_PTR
),
GetCurrentProcessId
());
pServer
->
hszServiceSpec
=
DdeCreateStringHandleW
(
pInstance
->
instanceID
,
buf2
,
CP_WINUNICODE
);
pServer
->
atomService
=
WDML_MakeAtomFromHsz
(
pServer
->
hszService
);
...
...
dlls/user32/dde_server.c
View file @
5ad25c29
...
...
@@ -39,9 +39,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
ddeml
);
static
const
WCHAR
szServerNameClass
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'D'
,
'd'
,
'e'
,
'S'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
'N'
,
'a'
,
'm'
,
'e'
,
0
};
const
char
WDML_szServerConvClassA
[]
=
"WineDdeServerConvA"
;
const
WCHAR
WDML_szServerConvClassW
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
'D'
,
'd'
,
'e'
,
'S'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
'C'
,
'o'
,
'n'
,
'v'
,
'W'
,
0
}
;
const
WCHAR
WDML_szServerConvClassW
[]
=
L"WineDdeServerConvW"
;
static
LRESULT
CALLBACK
WDML_ServerNameProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
static
LRESULT
CALLBACK
WDML_ServerConvProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
...
...
@@ -230,15 +229,12 @@ HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd)
wndclass
.
hCursor
=
0
;
wndclass
.
hbrBackground
=
0
;
wndclass
.
lpszMenuName
=
NULL
;
wndclass
.
lpszClassName
=
szServerNameClass
;
wndclass
.
lpszClassName
=
L"WineDdeServerName"
;
wndclass
.
hIconSm
=
0
;
RegisterClassExW
(
&
wndclass
);
hwndServer
=
CreateWindowW
(
szServerNameClass
,
NULL
,
WS_POPUP
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
hwndServer
=
CreateWindowW
(
L"WineDdeServerName"
,
NULL
,
WS_POPUP
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
SetWindowLongPtrW
(
hwndServer
,
GWL_WDML_INSTANCE
,
(
ULONG_PTR
)
pInstance
);
SetWindowLongPtrW
(
hwndServer
,
GWL_WDML_SERVER
,
(
ULONG_PTR
)
pServer
);
TRACE
(
"Created nameServer=%p for instance=%08x
\n
"
,
hwndServer
,
idInst
);
...
...
dlls/user32/defwnd.c
View file @
5ad25c29
...
...
@@ -123,7 +123,6 @@ static LRESULT DEFWND_SetTextA( HWND hwnd, LPCSTR text )
*/
static
LRESULT
DEFWND_SetTextW
(
HWND
hwnd
,
LPCWSTR
text
)
{
static
const
WCHAR
empty_string
[]
=
{
0
};
WND
*
wndPtr
;
int
count
;
...
...
@@ -132,7 +131,7 @@ static LRESULT DEFWND_SetTextW( HWND hwnd, LPCWSTR text )
if
(
text
&&
IS_INTRESOURCE
(
text
))
return
0
;
if
(
!
text
)
text
=
empty_string
;
if
(
!
text
)
text
=
L""
;
count
=
lstrlenW
(
text
)
+
1
;
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwnd
)))
return
0
;
...
...
dlls/user32/desktop.c
View file @
5ad25c29
...
...
@@ -92,13 +92,6 @@ static void init_wallpaper( const WCHAR *wallpaper )
*/
LRESULT
WINAPI
DesktopWndProc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
static
const
WCHAR
display_device_guid_propW
[]
=
{
'_'
,
'_'
,
'w'
,
'i'
,
'n'
,
'e'
,
'_'
,
'd'
,
'i'
,
's'
,
'p'
,
'l'
,
'a'
,
'y'
,
'_'
,
'd'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'_'
,
'g'
,
'u'
,
'i'
,
'd'
,
0
};
static
const
WCHAR
guid_formatW
[]
=
{
'%'
,
'0'
,
'8'
,
'x'
,
'-'
,
'%'
,
'0'
,
'4'
,
'x'
,
'-'
,
'%'
,
'0'
,
'4'
,
'x'
,
'-'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'-'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
0
};
switch
(
message
)
{
case
WM_NCCREATE
:
...
...
@@ -113,11 +106,12 @@ LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lP
if
(
GetAncestor
(
hwnd
,
GA_PARENT
))
return
FALSE
;
/* refuse to create non-desktop window */
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
guid_formatW
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]
);
atom
=
GlobalAddAtomW
(
buffer
);
SetPropW
(
hwnd
,
display_device_guid_propW
,
ULongToHandle
(
atom
)
);
SetPropW
(
hwnd
,
L"__wine_display_device_guid"
,
ULongToHandle
(
atom
)
);
}
return
TRUE
;
}
...
...
dlls/user32/dialog.c
View file @
5ad25c29
...
...
@@ -139,14 +139,14 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
if
(
GET_WORD
(
p
)
==
0xffff
)
{
static
const
WCHAR
class_names
[
6
][
10
]
=
static
const
WCHAR
*
class_names
[
6
]
=
{
{
'B'
,
'u'
,
't'
,
't'
,
'o'
,
'n'
,
},
/* 0x80 */
{
'E'
,
'd'
,
'i'
,
't'
,
},
/* 0x81 */
{
'S'
,
't'
,
'a'
,
't'
,
'i'
,
'c'
,
},
/* 0x82 */
{
'L'
,
'i'
,
's'
,
't'
,
'B'
,
'o'
,
'x'
,
},
/* 0x83 */
{
'S'
,
'c'
,
'r'
,
'o'
,
'l'
,
'l'
,
'B'
,
'a'
,
'r'
,
}
,
/* 0x84 */
{
'C'
,
'o'
,
'm'
,
'b'
,
'o'
,
'B'
,
'o'
,
'x'
,
}
/* 0x85 */
L"Button"
,
/* 0x80 */
L"Edit"
,
/* 0x81 */
L"Static"
,
/* 0x82 */
L"ListBox"
,
/* 0x83 */
L"ScrollBar"
,
/* 0x84 */
L"ComboBox"
/* 0x85 */
};
WORD
id
=
GET_WORD
(
p
+
1
);
/* Windows treats dialog control class ids 0-5 same way as 0x80-0x85 */
...
...
@@ -1816,8 +1816,8 @@ static INT DIALOG_DlgDirListW( HWND hDlg, LPWSTR spec, INT idLBox,
{
HWND
hwnd
;
LPWSTR
orig_spec
=
spec
;
WCHAR
any
[]
=
{
'*'
,
'.'
,
'*'
,
0
}
;
WCHAR
star
[]
=
{
'*'
,
0
}
;
WCHAR
any
[]
=
L"*.*"
;
WCHAR
star
[]
=
L"*"
;
#define SENDMSG(msg,wparam,lparam) \
((attrib & DDL_POSTMSGS) ? PostMessageW( hwnd, msg, wparam, lparam ) \
...
...
dlls/user32/driver.c
View file @
5ad25c29
...
...
@@ -45,22 +45,11 @@ static BOOL CDECL nodrv_CreateWindow( HWND hwnd );
static
BOOL
load_desktop_driver
(
HWND
hwnd
,
HMODULE
*
module
)
{
static
const
WCHAR
display_device_guid_propW
[]
=
{
'_'
,
'_'
,
'w'
,
'i'
,
'n'
,
'e'
,
'_'
,
'd'
,
'i'
,
's'
,
'p'
,
'l'
,
'a'
,
'y'
,
'_'
,
'd'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'_'
,
'g'
,
'u'
,
'i'
,
'd'
,
0
};
static
const
WCHAR
key_pathW
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'\\'
,
'V'
,
'i'
,
'd'
,
'e'
,
'o'
,
'\\'
,
'{'
,
0
};
static
const
WCHAR
displayW
[]
=
{
'}'
,
'\\'
,
'0'
,
'0'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
driverW
[]
=
{
'G'
,
'r'
,
'a'
,
'p'
,
'h'
,
'i'
,
'c'
,
's'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
nullW
[]
=
{
'n'
,
'u'
,
'l'
,
'l'
,
0
};
BOOL
ret
=
FALSE
;
HKEY
hkey
;
DWORD
size
;
WCHAR
path
[
MAX_PATH
];
WCHAR
key
[
ARRAY_SIZE
(
key_pathW
)
+
ARRAY_SIZE
(
displayW
)
+
40
];
WCHAR
key
[
ARRAY_SIZE
(
L"System
\\
CurrentControlSet
\\
Control
\\
Video
\\
{}
\\
0000"
)
+
40
];
UINT
guid_atom
;
USER_CheckNotLock
();
...
...
@@ -68,15 +57,15 @@ static BOOL load_desktop_driver( HWND hwnd, HMODULE *module )
strcpy
(
driver_load_error
,
"The explorer process failed to start."
);
/* default error */
SendMessageW
(
hwnd
,
WM_NULL
,
0
,
0
);
/* wait for the desktop process to be ready */
guid_atom
=
HandleToULong
(
GetPropW
(
hwnd
,
display_device_guid_propW
));
memcpy
(
key
,
key_pathW
,
sizeof
(
key_pathW
)
);
guid_atom
=
HandleToULong
(
GetPropW
(
hwnd
,
L"__wine_display_device_guid"
));
lstrcpyW
(
key
,
L"System
\\
CurrentControlSet
\\
Control
\\
Video
\\
{"
);
if
(
!
GlobalGetAtomNameW
(
guid_atom
,
key
+
lstrlenW
(
key
),
40
))
return
0
;
lstrcatW
(
key
,
displayW
);
lstrcatW
(
key
,
L"}
\\
0000"
);
if
(
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
key
,
&
hkey
))
return
0
;
size
=
sizeof
(
path
);
if
(
!
RegQueryValueExW
(
hkey
,
driverW
,
NULL
,
NULL
,
(
BYTE
*
)
path
,
&
size
))
if
(
!
RegQueryValueExW
(
hkey
,
L"GraphicsDriver"
,
NULL
,
NULL
,
(
BYTE
*
)
path
,
&
size
))
{
if
((
ret
=
!
wcscmp
(
path
,
nullW
)))
*
module
=
NULL
;
if
((
ret
=
!
wcscmp
(
path
,
L"null"
)))
*
module
=
NULL
;
else
ret
=
(
*
module
=
LoadLibraryW
(
path
))
!=
NULL
;
if
(
!
ret
)
ERR
(
"failed to load %s
\n
"
,
debugstr_w
(
path
)
);
TRACE
(
"%s %p
\n
"
,
debugstr_w
(
path
),
*
module
);
...
...
@@ -214,7 +203,6 @@ static UINT CDECL nulldrv_GetKeyboardLayoutList( INT size, HKL *layouts )
INT
count
=
0
;
ULONG_PTR
baselayout
;
LANGID
langid
;
static
const
WCHAR
szKeyboardReg
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'\\'
,
'K'
,
'e'
,
'y'
,
'b'
,
'o'
,
'a'
,
'r'
,
'd'
,
' '
,
'L'
,
'a'
,
'y'
,
'o'
,
'u'
,
't'
,
's'
,
0
};
baselayout
=
GetUserDefaultLCID
();
langid
=
PRIMARYLANGID
(
LANGIDFROMLCID
(
baselayout
));
...
...
@@ -224,7 +212,7 @@ static UINT CDECL nulldrv_GetKeyboardLayoutList( INT size, HKL *layouts )
baselayout
|=
baselayout
<<
16
;
/* Enumerate the Registry */
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
szKeyboardReg
,
&
hKeyKeyboard
);
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
L"System
\\
CurrentControlSet
\\
Control
\\
Keyboard Layouts"
,
&
hKeyKeyboard
);
if
(
rc
==
ERROR_SUCCESS
)
{
do
{
...
...
dlls/user32/edit.c
View file @
5ad25c29
...
...
@@ -3193,18 +3193,16 @@ static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c)
EDIT_MoveHome
(
es
,
FALSE
,
FALSE
);
EDIT_MoveDown_ML
(
es
,
FALSE
);
}
else
{
static
const
WCHAR
cr_lfW
[]
=
{
'\r'
,
'\n'
};
EDIT_EM_ReplaceSel
(
es
,
TRUE
,
cr_lfW
,
2
,
TRUE
,
TRUE
);
EDIT_EM_ReplaceSel
(
es
,
TRUE
,
L"
\r\n
"
,
2
,
TRUE
,
TRUE
);
}
}
break
;
case
'\t'
:
if
((
es
->
style
&
ES_MULTILINE
)
&&
!
(
es
->
style
&
ES_READONLY
))
{
static
const
WCHAR
tabW
[]
=
{
'\t'
};
if
(
EDIT_IsInsideDialog
(
es
))
break
;
EDIT_EM_ReplaceSel
(
es
,
TRUE
,
tabW
,
1
,
TRUE
,
TRUE
);
EDIT_EM_ReplaceSel
(
es
,
TRUE
,
L"
\t
"
,
1
,
TRUE
,
TRUE
);
}
break
;
case
VK_BACK
:
...
...
@@ -5250,10 +5248,9 @@ LRESULT EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, B
/*********************************************************************
* edit class descriptor
*/
static
const
WCHAR
editW
[]
=
{
'E'
,
'd'
,
'i'
,
't'
,
0
};
const
struct
builtin_class_descr
EDIT_builtin_class
=
{
editW
,
/* name */
L"Edit"
,
/* name */
CS_DBLCLKS
|
CS_PARENTDC
,
/* style */
WINPROC_EDIT
,
/* proc */
#ifdef __i386__
...
...
dlls/user32/icontitle.c
View file @
5ad25c29
...
...
@@ -50,7 +50,6 @@ const struct builtin_class_descr ICONTITLE_builtin_class =
*/
static
BOOL
ICONTITLE_SetTitlePos
(
HWND
hwnd
,
HWND
owner
)
{
static
const
WCHAR
emptyTitleText
[]
=
{
'<'
,
'.'
,
'.'
,
'.'
,
'>'
,
0
};
WCHAR
str
[
80
];
HDC
hDC
;
HFONT
hPrevFont
;
...
...
@@ -65,7 +64,7 @@ static BOOL ICONTITLE_SetTitlePos( HWND hwnd, HWND owner )
if
(
!
length
)
{
lstrcpyW
(
str
,
emptyTitleText
);
lstrcpyW
(
str
,
L"<...>"
);
length
=
lstrlenW
(
str
);
}
...
...
dlls/user32/listbox.c
View file @
5ad25c29
...
...
@@ -244,10 +244,9 @@ static void remove_item_data(LB_DESCR *descr, UINT index)
/*********************************************************************
* listbox class descriptor
*/
static
const
WCHAR
listboxW
[]
=
{
'L'
,
'i'
,
's'
,
't'
,
'B'
,
'o'
,
'x'
,
0
};
const
struct
builtin_class_descr
LISTBOX_builtin_class
=
{
listboxW
,
/* name */
L"ListBox"
,
/* name */
CS_DBLCLKS
/*| CS_PARENTDC*/
,
/* style */
WINPROC_LISTBOX
,
/* proc */
sizeof
(
LB_DESCR
*
),
/* extra */
...
...
@@ -259,10 +258,9 @@ const struct builtin_class_descr LISTBOX_builtin_class =
/*********************************************************************
* combolbox class descriptor
*/
static
const
WCHAR
combolboxW
[]
=
{
'C'
,
'o'
,
'm'
,
'b'
,
'o'
,
'L'
,
'B'
,
'o'
,
'x'
,
0
};
const
struct
builtin_class_descr
COMBOLBOX_builtin_class
=
{
combolboxW
,
/* name */
L"ComboLBox"
,
/* name */
CS_DBLCLKS
|
CS_SAVEBITS
,
/* style */
WINPROC_LISTBOX
,
/* proc */
sizeof
(
LB_DESCR
*
),
/* extra */
...
...
@@ -1701,8 +1699,7 @@ static LRESULT LISTBOX_InsertString( LB_DESCR *descr, INT index, LPCWSTR str )
if
(
HAS_STRINGS
(
descr
))
{
static
const
WCHAR
empty_stringW
[]
=
{
0
};
if
(
!
str
)
str
=
empty_stringW
;
if
(
!
str
)
str
=
L""
;
if
(
!
(
new_str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
)
)))
{
SEND_NOTIFICATION
(
descr
,
LBN_ERRSPACE
);
...
...
@@ -1896,16 +1893,14 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib,
WCHAR
buffer
[
270
];
if
(
entry
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
{
static
const
WCHAR
bracketW
[]
=
{
']'
,
0
};
static
const
WCHAR
dotW
[]
=
{
'.'
,
0
};
if
(
!
(
attrib
&
DDL_DIRECTORY
)
||
!
wcscmp
(
entry
.
cFileName
,
dotW
))
continue
;
!
wcscmp
(
entry
.
cFileName
,
L"."
))
continue
;
buffer
[
0
]
=
'['
;
if
(
!
long_names
&&
entry
.
cAlternateFileName
[
0
])
lstrcpyW
(
buffer
+
1
,
entry
.
cAlternateFileName
);
else
lstrcpyW
(
buffer
+
1
,
entry
.
cFileName
);
lstrcatW
(
buffer
,
bracketW
);
lstrcatW
(
buffer
,
L"]"
);
}
else
/* not a directory */
{
...
...
@@ -1937,8 +1932,8 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib,
/* scan drives */
if
(
attrib
&
DDL_DRIVES
)
{
WCHAR
buffer
[]
=
{
'['
,
'-'
,
'a'
,
'-'
,
']'
,
0
}
;
WCHAR
root
[]
=
{
'A'
,
':'
,
'\\'
,
0
}
;
WCHAR
buffer
[]
=
L"[-a-]"
;
WCHAR
root
[]
=
L"A:
\\
"
;
int
drive
;
for
(
drive
=
0
;
drive
<
26
;
drive
++
,
buffer
[
2
]
++
,
root
[
0
]
++
)
{
...
...
dlls/user32/mdi.c
View file @
5ad25c29
...
...
@@ -182,10 +182,9 @@ static void MDI_PostUpdate(HWND hwnd, MDICLIENTINFO* ci, WORD recalc)
/*********************************************************************
* MDIClient class descriptor
*/
static
const
WCHAR
mdiclientW
[]
=
{
'M'
,
'D'
,
'I'
,
'C'
,
'l'
,
'i'
,
'e'
,
'n'
,
't'
,
0
};
const
struct
builtin_class_descr
MDICLIENT_builtin_class
=
{
mdiclientW
,
/* name */
L"MDIClient"
,
/* name */
0
,
/* style */
WINPROC_MDICLIENT
,
/* proc */
sizeof
(
MDICLIENTINFO
),
/* extra */
...
...
@@ -993,19 +992,16 @@ static void MDI_UpdateFrameText( HWND frame, HWND hClient, BOOL repaint, LPCWSTR
if
(
ci
->
hwndChildMaximized
)
{
/* combine frame title and child title if possible */
static
const
WCHAR
lpBracket
[]
=
{
' '
,
'-'
,
' '
,
'['
,
0
};
static
const
WCHAR
lpBracket2
[]
=
{
']'
,
0
};
int
i_frame_text_length
=
lstrlenW
(
ci
->
frameTitle
);
lstrcpynW
(
lpBuffer
,
ci
->
frameTitle
,
MDI_MAXTITLELENGTH
);
if
(
i_frame_text_length
+
6
<
MDI_MAXTITLELENGTH
)
{
lstrcatW
(
lpBuffer
,
lpBracket
);
lstrcatW
(
lpBuffer
,
L" - ["
);
if
(
GetWindowTextW
(
ci
->
hwndActiveChild
,
lpBuffer
+
i_frame_text_length
+
4
,
MDI_MAXTITLELENGTH
-
i_frame_text_length
-
5
))
lstrcatW
(
lpBuffer
,
lpBracket2
);
lstrcatW
(
lpBuffer
,
L"]"
);
else
lpBuffer
[
i_frame_text_length
]
=
0
;
/* remove bracket */
}
...
...
dlls/user32/menu.c
View file @
5ad25c29
...
...
@@ -400,9 +400,7 @@ static inline UINT get_scroll_arrow_height(const POPUPMENU *menu)
*/
static
HMENU
MENU_CopySysPopup
(
BOOL
mdi
)
{
static
const
WCHAR
sysmenuW
[]
=
{
'S'
,
'Y'
,
'S'
,
'M'
,
'E'
,
'N'
,
'U'
,
0
};
static
const
WCHAR
sysmenumdiW
[]
=
{
'S'
,
'Y'
,
'S'
,
'M'
,
'E'
,
'N'
,
'U'
,
'M'
,
'D'
,
'I'
,
0
};
HMENU
hMenu
=
LoadMenuW
(
user32_module
,
(
mdi
?
sysmenumdiW
:
sysmenuW
));
HMENU
hMenu
=
LoadMenuW
(
user32_module
,
mdi
?
L"SYSMENUMDI"
:
L"SYSMENU"
);
if
(
hMenu
)
{
MENUINFO
minfo
;
...
...
@@ -979,9 +977,7 @@ static void MENU_DrawBitmapItem( HDC hdc, MENUITEM *lpitem, const RECT *rect,
/* draw the magic bitmaps using marlett font characters */
/* FIXME: fontsize and the position (x,y) could probably be better */
HFONT
hfont
,
hfontsav
;
LOGFONTW
logfont
=
{
0
,
0
,
0
,
0
,
FW_NORMAL
,
0
,
0
,
0
,
SYMBOL_CHARSET
,
0
,
0
,
0
,
0
,
{
'M'
,
'a'
,
'r'
,
'l'
,
'e'
,
't'
,
't'
,
0
}
};
LOGFONTW
logfont
=
{
0
,
0
,
0
,
0
,
FW_NORMAL
,
0
,
0
,
0
,
SYMBOL_CHARSET
,
0
,
0
,
0
,
0
,
L"Marlett"
};
logfont
.
lfHeight
=
min
(
h
,
w
)
-
5
;
TRACE
(
" height %d rect %s
\n
"
,
logfont
.
lfHeight
,
wine_dbgstr_rect
(
rect
));
hfont
=
CreateFontIndirectW
(
&
logfont
);
...
...
dlls/user32/message.c
View file @
5ad25c29
...
...
@@ -280,11 +280,9 @@ static const INPUT_MESSAGE_SOURCE msg_source_unavailable = { IMDT_UNAVAILABLE, I
/* Message class descriptor */
static
const
WCHAR
messageW
[]
=
{
'M'
,
'e'
,
's'
,
's'
,
'a'
,
'g'
,
'e'
,
0
};
const
struct
builtin_class_descr
MESSAGE_builtin_class
=
{
messageW
,
/* name */
L"Message"
,
/* name */
0
,
/* style */
WINPROC_MESSAGE
,
/* proc */
0
,
/* extra */
...
...
dlls/user32/misc.c
View file @
5ad25c29
...
...
@@ -322,8 +322,7 @@ VOID WINAPI LoadLocalFonts(VOID)
*/
BOOL
WINAPI
User32InitializeImmEntryTable
(
DWORD
magic
)
{
static
const
WCHAR
imm32_dllW
[]
=
{
'i'
,
'm'
,
'm'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
HMODULE
imm32
=
GetModuleHandleW
(
imm32_dllW
);
HMODULE
imm32
=
GetModuleHandleW
(
L"imm32.dll"
);
TRACE
(
"(%x)
\n
"
,
magic
);
...
...
@@ -531,10 +530,9 @@ BOOL WINAPI GetPointerType(UINT32 id, POINTER_INPUT_TYPE *type)
return
TRUE
;
}
static
const
WCHAR
imeW
[]
=
{
'I'
,
'M'
,
'E'
,
0
};
const
struct
builtin_class_descr
IME_builtin_class
=
{
imeW
,
/* name */
L"IME"
,
/* name */
0
,
/* style */
WINPROC_IME
,
/* proc */
2
*
sizeof
(
LONG_PTR
),
/* extra */
...
...
dlls/user32/msgbox.c
View file @
5ad25c29
...
...
@@ -518,13 +518,11 @@ INT WINAPI MessageBoxIndirectW( LPMSGBOXPARAMSW msgbox )
int
ret
;
UINT
i
;
struct
ThreadWindows
threadWindows
;
static
const
WCHAR
msg_box_res_nameW
[]
=
{
'M'
,
'S'
,
'G'
,
'B'
,
'O'
,
'X'
,
0
};
if
(
!
(
hRes
=
FindResourceExW
(
user32_module
,
(
LPWSTR
)
RT_DIALOG
,
msg_box_res_nameW
,
msgbox
->
dwLanguageId
)))
if
(
!
(
hRes
=
FindResourceExW
(
user32_module
,
(
LPWSTR
)
RT_DIALOG
,
L"MSGBOX"
,
msgbox
->
dwLanguageId
)))
{
if
(
!
msgbox
->
dwLanguageId
||
!
(
hRes
=
FindResourceExW
(
user32_module
,
(
LPWSTR
)
RT_DIALOG
,
msg_box_res_nameW
,
LANG_NEUTRAL
)))
!
(
hRes
=
FindResourceExW
(
user32_module
,
(
LPWSTR
)
RT_DIALOG
,
L"MSGBOX"
,
LANG_NEUTRAL
)))
return
0
;
}
if
(
!
(
tmplate
=
LoadResource
(
user32_module
,
hRes
)))
...
...
dlls/user32/painting.c
View file @
5ad25c29
...
...
@@ -57,8 +57,6 @@ static struct list dce_list = LIST_INIT(dce_list);
static
BOOL
CALLBACK
dc_hook
(
HDC
hDC
,
WORD
code
,
DWORD_PTR
data
,
LPARAM
lParam
);
static
const
WCHAR
displayW
[]
=
{
'D'
,
'I'
,
'S'
,
'P'
,
'L'
,
'A'
,
'Y'
,
0
};
/***********************************************************************
* dump_rdw_flags
...
...
@@ -225,7 +223,7 @@ static struct dce *alloc_dce(void)
struct
dce
*
dce
;
if
(
!
(
dce
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
dce
)
)))
return
NULL
;
if
(
!
(
dce
->
hdc
=
CreateDCW
(
displayW
,
NULL
,
NULL
,
NULL
)))
if
(
!
(
dce
->
hdc
=
CreateDCW
(
L"DISPLAY"
,
NULL
,
NULL
,
NULL
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
dce
);
return
0
;
...
...
dlls/user32/rawinput.c
View file @
5ad25c29
...
...
@@ -645,8 +645,6 @@ UINT WINAPI GetRawInputDeviceInfoA(HANDLE device, UINT command, void *data, UINT
UINT
WINAPI
GetRawInputDeviceInfoW
(
HANDLE
handle
,
UINT
command
,
void
*
data
,
UINT
*
data_size
)
{
/* FIXME: Most of this is made up. */
static
const
WCHAR
keyboard_name
[]
=
{
'\\'
,
'\\'
,
'?'
,
'\\'
,
'W'
,
'I'
,
'N'
,
'E'
,
'_'
,
'K'
,
'E'
,
'Y'
,
'B'
,
'O'
,
'A'
,
'R'
,
'D'
,
0
};
static
const
WCHAR
mouse_name
[]
=
{
'\\'
,
'\\'
,
'?'
,
'\\'
,
'W'
,
'I'
,
'N'
,
'E'
,
'_'
,
'M'
,
'O'
,
'U'
,
'S'
,
'E'
,
0
};
static
const
RID_DEVICE_INFO_KEYBOARD
keyboard_info
=
{
0
,
0
,
1
,
12
,
3
,
101
};
static
const
RID_DEVICE_INFO_MOUSE
mouse_info
=
{
1
,
5
,
0
,
FALSE
};
...
...
@@ -673,13 +671,13 @@ UINT WINAPI GetRawInputDeviceInfoW(HANDLE handle, UINT command, void *data, UINT
avail_bytes
=
*
data_size
*
sizeof
(
WCHAR
);
if
(
handle
==
WINE_MOUSE_HANDLE
)
{
*
data_size
=
ARRAY_SIZE
(
mouse_name
);
to_copy
=
mouse_name
;
*
data_size
=
ARRAY_SIZE
(
L"
\\\\
?
\\
WINE_MOUSE"
);
to_copy
=
L"
\\\\
?
\\
WINE_MOUSE"
;
}
else
if
(
handle
==
WINE_KEYBOARD_HANDLE
)
{
*
data_size
=
ARRAY_SIZE
(
keyboard_name
);
to_copy
=
keyboard_name
;
*
data_size
=
ARRAY_SIZE
(
L"
\\\\
?
\\
WINE_KEYBOARD"
);
to_copy
=
L"
\\\\
?
\\
WINE_KEYBOARD"
;
}
else
{
...
...
dlls/user32/scroll.c
View file @
5ad25c29
...
...
@@ -118,10 +118,9 @@ static void SCROLL_DrawInterior_9x( HWND hwnd, HDC hdc, INT nBar,
/*********************************************************************
* scrollbar class descriptor
*/
static
const
WCHAR
scrollbarW
[]
=
{
'S'
,
'c'
,
'r'
,
'o'
,
'l'
,
'l'
,
'B'
,
'a'
,
'r'
,
0
};
const
struct
builtin_class_descr
SCROLL_builtin_class
=
{
scrollbarW
,
/* name */
L"ScrollBar"
,
/* name */
CS_DBLCLKS
|
CS_VREDRAW
|
CS_HREDRAW
|
CS_PARENTDC
,
/* style */
WINPROC_SCROLLBAR
,
/* proc */
sizeof
(
SCROLLBAR_WNDDATA
),
/* extra */
...
...
dlls/user32/spy.c
View file @
5ad25c29
...
...
@@ -1671,9 +1671,6 @@ static const USER_MSG propsht_array[] = {
USM
(
PSM_SETTITLEW
,
0
),
USM
(
PSM_SETFINISHTEXTW
,
0
),
};
static
const
WCHAR
PropSheetInfoStr
[]
=
{
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'y'
,
'S'
,
'h'
,
'e'
,
'e'
,
't'
,
'I'
,
'n'
,
'f'
,
'o'
,
0
};
static
const
USER_MSG
updown_array
[]
=
{
USM
(
UDM_SETRANGE
,
0
),
USM
(
UDM_GETRANGE
,
0
),
...
...
@@ -2145,7 +2142,7 @@ static void SPY_GetClassName( SPY_INSTANCE *sp_e )
{
/* special code to detect a property sheet dialog */
if
((
GetClassLongW
(
sp_e
->
msg_hwnd
,
GCW_ATOM
)
==
WC_DIALOG
)
&&
(
GetPropW
(
sp_e
->
msg_hwnd
,
PropSheetInfoStr
)))
{
(
GetPropW
(
sp_e
->
msg_hwnd
,
L"PropertySheetInfo"
)))
{
lstrcpyW
(
sp_e
->
wnd_class
,
WC_PROPSHEETW
);
}
else
{
...
...
dlls/user32/static.c
View file @
5ad25c29
...
...
@@ -83,10 +83,9 @@ static const pfPaint staticPaintFunc[SS_TYPEMASK+1] =
/*********************************************************************
* static class descriptor
*/
static
const
WCHAR
staticW
[]
=
{
'S'
,
't'
,
'a'
,
't'
,
'i'
,
'c'
,
0
};
const
struct
builtin_class_descr
STATIC_builtin_class
=
{
staticW
,
/* name */
L"Static"
,
/* name */
CS_DBLCLKS
|
CS_PARENTDC
,
/* style */
WINPROC_STATIC
,
/* proc */
STATIC_EXTRA_BYTES
,
/* extra */
...
...
dlls/user32/sysparams.c
View file @
5ad25c29
This diff is collapsed.
Click to expand it.
dlls/user32/text.c
View file @
5ad25c29
...
...
@@ -91,7 +91,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(text);
#define FORWARD_SLASH '/'
#define BACK_SLASH '\\'
static
const
WCHAR
ELLIPSISW
[]
=
{
'.'
,
'.'
,
'.'
,
0
}
;
static
const
WCHAR
ELLIPSISW
[]
=
L"..."
;
typedef
struct
tag_ellipsis_data
{
...
...
dlls/user32/uitools.c
View file @
5ad25c29
...
...
@@ -918,7 +918,6 @@ static BOOL UITOOLS95_DrawFrameCaption(HDC dc, LPRECT r, UINT uFlags)
int
xc
=
(
myr
.
left
+
myr
.
right
)
/
2
;
int
yc
=
(
myr
.
top
+
myr
.
bottom
)
/
2
;
WCHAR
str
[]
=
{
0
,
0
};
static
const
WCHAR
glyphFontName
[]
=
{
'M'
,
'a'
,
'r'
,
'l'
,
'e'
,
't'
,
't'
,
0
};
UINT
alignsave
;
int
bksave
;
COLORREF
clrsave
;
...
...
@@ -940,7 +939,7 @@ static BOOL UITOOLS95_DrawFrameCaption(HDC dc, LPRECT r, UINT uFlags)
hf
=
CreateFontW
(
-
SmallDiam
,
0
,
0
,
0
,
FW_NORMAL
,
FALSE
,
FALSE
,
FALSE
,
SYMBOL_CHARSET
,
OUT_DEFAULT_PRECIS
,
CLIP_DEFAULT_PRECIS
,
DEFAULT_QUALITY
,
FIXED_PITCH
|
FF_DONTCARE
,
glyphFontName
);
DEFAULT_QUALITY
,
FIXED_PITCH
|
FF_DONTCARE
,
L"Marlett"
);
alignsave
=
SetTextAlign
(
dc
,
TA_TOP
|
TA_LEFT
);
bksave
=
SetBkMode
(
dc
,
TRANSPARENT
);
clrsave
=
GetTextColor
(
dc
);
...
...
dlls/user32/user_main.c
View file @
5ad25c29
...
...
@@ -166,52 +166,43 @@ static void palette_init(void)
*/
static
const
WCHAR
*
get_default_desktop
(
void
)
{
static
const
WCHAR
defaultW
[]
=
{
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
0
};
static
const
WCHAR
desktopW
[]
=
{
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
0
};
static
const
WCHAR
explorerW
[]
=
{
'\\'
,
'E'
,
'x'
,
'p'
,
'l'
,
'o'
,
'r'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
app_defaultsW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'A'
,
'p'
,
'p'
,
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
's'
,
0
};
static
WCHAR
buffer
[
MAX_PATH
+
ARRAY_SIZE
(
explorerW
)];
static
WCHAR
buffer
[
MAX_PATH
+
ARRAY_SIZE
(
L"
\\
Explorer"
)];
WCHAR
*
p
,
*
appname
=
buffer
;
const
WCHAR
*
ret
=
NULL
;
DWORD
len
;
HKEY
tmpkey
,
appkey
;
len
=
(
GetModuleFileNameW
(
0
,
buffer
,
MAX_PATH
));
if
(
!
len
||
len
>=
MAX_PATH
)
return
defaultW
;
if
(
!
len
||
len
>=
MAX_PATH
)
return
L"Default"
;
if
((
p
=
wcsrchr
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
wcsrchr
(
appname
,
'\\'
)))
appname
=
p
+
1
;
p
=
appname
+
lstrlenW
(
appname
);
lstrcpyW
(
p
,
explorerW
);
lstrcpyW
(
p
,
L"
\\
Explorer"
);
/* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\Explorer */
if
(
!
RegOpenKeyW
(
HKEY_CURRENT_USER
,
app_defaultsW
,
&
tmpkey
))
if
(
!
RegOpenKeyW
(
HKEY_CURRENT_USER
,
L"Software
\\
Wine
\\
AppDefaults"
,
&
tmpkey
))
{
if
(
RegOpenKeyW
(
tmpkey
,
appname
,
&
appkey
))
appkey
=
0
;
RegCloseKey
(
tmpkey
);
if
(
appkey
)
{
len
=
sizeof
(
buffer
);
if
(
!
RegQueryValueExW
(
appkey
,
desktopW
,
0
,
NULL
,
(
LPBYTE
)
buffer
,
&
len
))
ret
=
buffer
;
if
(
!
RegQueryValueExW
(
appkey
,
L"Desktop"
,
0
,
NULL
,
(
LPBYTE
)
buffer
,
&
len
))
ret
=
buffer
;
RegCloseKey
(
appkey
);
if
(
ret
&&
*
ret
)
return
ret
;
ret
=
NULL
;
}
}
memcpy
(
buffer
,
app_defaultsW
,
13
*
sizeof
(
WCHAR
)
);
/* copy only software\\wine */
lstrcpyW
(
buffer
+
13
,
explorerW
);
/* @@ Wine registry key: HKCU\Software\Wine\Explorer */
if
(
!
RegOpenKeyW
(
HKEY_CURRENT_USER
,
buffer
,
&
appkey
))
if
(
!
RegOpenKeyW
(
HKEY_CURRENT_USER
,
L"Software
\\
Wine
\\
Explorer"
,
&
appkey
))
{
len
=
sizeof
(
buffer
);
if
(
!
RegQueryValueExW
(
appkey
,
desktopW
,
0
,
NULL
,
(
LPBYTE
)
buffer
,
&
len
))
ret
=
buffer
;
if
(
!
RegQueryValueExW
(
appkey
,
L"Desktop"
,
0
,
NULL
,
(
LPBYTE
)
buffer
,
&
len
))
ret
=
buffer
;
RegCloseKey
(
appkey
);
if
(
ret
&&
*
ret
)
return
ret
;
}
return
defaultW
;
return
L"Default"
;
}
...
...
@@ -224,13 +215,9 @@ static void dpiaware_init(void)
{
WCHAR
buffer
[
256
];
DWORD
option
;
static
const
WCHAR
dpiAwareW
[]
=
{
'd'
,
'p'
,
'i'
,
'A'
,
'w'
,
'a'
,
'r'
,
'e'
,
0
};
static
const
WCHAR
dpiAwarenessW
[]
=
{
'd'
,
'p'
,
'i'
,
'A'
,
'w'
,
'a'
,
'r'
,
'e'
,
'n'
,
'e'
,
's'
,
's'
,
0
};
static
const
WCHAR
namespace2005W
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
's'
,
'c'
,
'h'
,
'e'
,
'm'
,
'a'
,
's'
,
'.'
,
'm'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'.'
,
'c'
,
'o'
,
'm'
,
'/'
,
'S'
,
'M'
,
'I'
,
'/'
,
'2'
,
'0'
,
'0'
,
'5'
,
'/'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'S'
,
'e'
,
't'
,
't'
,
'i'
,
'n'
,
'g'
,
's'
,
0
};
static
const
WCHAR
namespace2016W
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
's'
,
'c'
,
'h'
,
'e'
,
'm'
,
'a'
,
's'
,
'.'
,
'm'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'.'
,
'c'
,
'o'
,
'm'
,
'/'
,
'S'
,
'M'
,
'I'
,
'/'
,
'2'
,
'0'
,
'1'
,
'6'
,
'/'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'S'
,
'e'
,
't'
,
't'
,
'i'
,
'n'
,
'g'
,
's'
,
0
};
if
(
!
LdrQueryImageFileExecutionOptions
(
&
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
ImagePathName
,
dpiAwarenessW
,
REG_DWORD
,
&
option
,
sizeof
(
option
),
NULL
))
L"dpiAwareness"
,
REG_DWORD
,
&
option
,
sizeof
(
option
),
NULL
))
{
TRACE
(
"got option %x
\n
"
,
option
);
if
(
option
<=
2
)
...
...
@@ -240,24 +227,20 @@ static void dpiaware_init(void)
}
}
if
(
QueryActCtxSettingsW
(
0
,
NULL
,
namespace2016W
,
dpiAwarenessW
,
buffer
,
ARRAY_SIZE
(
buffer
),
NULL
))
if
(
QueryActCtxSettingsW
(
0
,
NULL
,
L"http://schemas.microsoft.com/SMI/2016/WindowsSettings"
,
L"dpiAwareness"
,
buffer
,
ARRAY_SIZE
(
buffer
),
NULL
))
{
static
const
WCHAR
unawareW
[]
=
{
'u'
,
'n'
,
'a'
,
'w'
,
'a'
,
'r'
,
'e'
,
0
};
static
const
WCHAR
systemW
[]
=
{
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
0
};
static
const
WCHAR
permonW
[]
=
{
'p'
,
'e'
,
'r'
,
'm'
,
'o'
,
'n'
,
'i'
,
't'
,
'o'
,
'r'
,
0
};
static
const
WCHAR
permonv2W
[]
=
{
'p'
,
'e'
,
'r'
,
'm'
,
'o'
,
'n'
,
'i'
,
't'
,
'o'
,
'r'
,
'v'
,
'2'
,
0
};
static
const
WCHAR
spacesW
[]
=
{
' '
,
'\t'
,
'\r'
,
'\n'
,
0
};
static
const
WCHAR
*
const
types
[]
=
{
unawareW
,
systemW
,
permonW
,
permonv2W
};
static
const
WCHAR
*
const
types
[]
=
{
L"unaware"
,
L"system"
,
L"permonitor"
,
L"permonitorv2"
};
WCHAR
*
p
,
*
start
,
*
end
;
ULONG_PTR
i
;
TRACE
(
"got dpiAwareness=%s
\n
"
,
debugstr_w
(
buffer
)
);
for
(
start
=
buffer
;
*
start
;
start
=
end
)
{
start
+=
wcsspn
(
start
,
spacesW
);
start
+=
wcsspn
(
start
,
L"
\t\r\n
"
);
if
(
!
(
end
=
wcschr
(
start
,
','
)))
end
=
start
+
lstrlenW
(
start
);
else
*
end
++
=
0
;
if
((
p
=
wcspbrk
(
start
,
spacesW
)))
*
p
=
0
;
if
((
p
=
wcspbrk
(
start
,
L"
\t\r\n
"
)))
*
p
=
0
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
types
);
i
++
)
{
if
(
wcsicmp
(
start
,
types
[
i
]
))
continue
;
...
...
@@ -266,16 +249,13 @@ static void dpiaware_init(void)
}
}
}
else
if
(
QueryActCtxSettingsW
(
0
,
NULL
,
namespace2005W
,
dpiAwareW
,
buffer
,
ARRAY_SIZE
(
buffer
),
NULL
))
else
if
(
QueryActCtxSettingsW
(
0
,
NULL
,
L"http://schemas.microsoft.com/SMI/2005/WindowsSettings"
,
L"dpiAware"
,
buffer
,
ARRAY_SIZE
(
buffer
),
NULL
))
{
static
const
WCHAR
trueW
[]
=
{
't'
,
'r'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
truepmW
[]
=
{
't'
,
'r'
,
'u'
,
'e'
,
'/'
,
'p'
,
'm'
,
0
};
static
const
WCHAR
permonW
[]
=
{
'p'
,
'e'
,
'r'
,
' '
,
'm'
,
'o'
,
'n'
,
'i'
,
't'
,
'o'
,
'r'
,
0
};
TRACE
(
"got dpiAware=%s
\n
"
,
debugstr_w
(
buffer
)
);
if
(
!
wcsicmp
(
buffer
,
trueW
))
if
(
!
wcsicmp
(
buffer
,
L"true"
))
SetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
);
else
if
(
!
wcsicmp
(
buffer
,
truepmW
)
||
!
wcsicmp
(
buffer
,
permonW
))
else
if
(
!
wcsicmp
(
buffer
,
L"true/pm"
)
||
!
wcsicmp
(
buffer
,
L"per monitor"
))
SetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
);
else
SetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_UNAWARE
);
...
...
@@ -290,8 +270,6 @@ static void dpiaware_init(void)
*/
static
void
winstation_init
(
void
)
{
static
const
WCHAR
WinSta0
[]
=
{
'W'
,
'i'
,
'n'
,
'S'
,
't'
,
'a'
,
'0'
,
0
};
STARTUPINFOW
info
;
WCHAR
*
winstation
=
NULL
,
*
desktop
=
NULL
,
*
buffer
=
NULL
;
HANDLE
handle
;
...
...
@@ -312,12 +290,12 @@ static void winstation_init(void)
/* set winstation if explicitly specified, or if we don't have one yet */
if
(
buffer
||
!
GetProcessWindowStation
())
{
handle
=
CreateWindowStationW
(
winstation
?
winstation
:
WinSta0
,
0
,
WINSTA_ALL_ACCESS
,
NULL
);
handle
=
CreateWindowStationW
(
winstation
?
winstation
:
L"WinSta0"
,
0
,
WINSTA_ALL_ACCESS
,
NULL
);
if
(
handle
)
{
SetProcessWindowStation
(
handle
);
/* only WinSta0 is visible */
if
(
!
winstation
||
!
wcsicmp
(
winstation
,
WinSta0
))
if
(
!
winstation
||
!
wcsicmp
(
winstation
,
L"WinSta0"
))
{
USEROBJECTFLAGS
flags
;
flags
.
fInherit
=
FALSE
;
...
...
@@ -395,7 +373,6 @@ static void thread_detach(void)
*/
BOOL
WINAPI
DllMain
(
HINSTANCE
inst
,
DWORD
reason
,
LPVOID
reserved
)
{
static
const
WCHAR
imm32_dllW
[]
=
{
'i'
,
'm'
,
'm'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
HMODULE
imm32_module
;
BOOL
ret
=
TRUE
;
...
...
@@ -405,7 +382,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
user32_module
=
inst
;
ret
=
process_attach
();
if
(
ret
)
imm32_module
=
LoadLibraryW
(
imm32_dllW
);
imm32_module
=
LoadLibraryW
(
L"imm32.dll"
);
break
;
case
DLL_THREAD_DETACH
:
thread_detach
();
...
...
@@ -425,29 +402,23 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
*/
BOOL
WINAPI
ExitWindowsEx
(
UINT
flags
,
DWORD
reason
)
{
static
const
WCHAR
winebootW
[]
=
{
'\\'
,
'w'
,
'i'
,
'n'
,
'e'
,
'b'
,
'o'
,
'o'
,
't'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
static
const
WCHAR
killW
[]
=
{
' '
,
'-'
,
'-'
,
'k'
,
'i'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
end_sessionW
[]
=
{
' '
,
'-'
,
'-'
,
'e'
,
'n'
,
'd'
,
'-'
,
's'
,
'e'
,
's'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
forceW
[]
=
{
' '
,
'-'
,
'-'
,
'f'
,
'o'
,
'r'
,
'c'
,
'e'
,
0
};
static
const
WCHAR
shutdownW
[]
=
{
' '
,
'-'
,
'-'
,
's'
,
'h'
,
'u'
,
't'
,
'd'
,
'o'
,
'w'
,
'n'
,
0
};
WCHAR
app
[
MAX_PATH
];
WCHAR
cmdline
[
MAX_PATH
+
64
];
PROCESS_INFORMATION
pi
;
STARTUPINFOW
si
;
void
*
redir
;
GetSystemDirectoryW
(
app
,
MAX_PATH
-
ARRAY_SIZE
(
winebootW
));
lstrcatW
(
app
,
winebootW
);
GetSystemDirectoryW
(
app
,
MAX_PATH
-
ARRAY_SIZE
(
L"
\\
wineboot.exe"
));
lstrcatW
(
app
,
L"
\\
wineboot.exe"
);
lstrcpyW
(
cmdline
,
app
);
if
(
flags
&
EWX_FORCE
)
lstrcatW
(
cmdline
,
killW
);
if
(
flags
&
EWX_FORCE
)
lstrcatW
(
cmdline
,
L" --kill"
);
else
{
lstrcatW
(
cmdline
,
end_sessionW
);
if
(
flags
&
EWX_FORCEIFHUNG
)
lstrcatW
(
cmdline
,
forceW
);
lstrcatW
(
cmdline
,
L" --end-session"
);
if
(
flags
&
EWX_FORCEIFHUNG
)
lstrcatW
(
cmdline
,
L" --force"
);
}
if
(
!
(
flags
&
EWX_REBOOT
))
lstrcatW
(
cmdline
,
shutdownW
);
if
(
!
(
flags
&
EWX_REBOOT
))
lstrcatW
(
cmdline
,
L" --shutdown"
);
memset
(
&
si
,
0
,
sizeof
si
);
si
.
cb
=
sizeof
si
;
...
...
dlls/user32/win.c
View file @
5ad25c29
...
...
@@ -1447,8 +1447,6 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
}
else
{
static
const
WCHAR
messageW
[]
=
{
'M'
,
'e'
,
's'
,
's'
,
'a'
,
'g'
,
'e'
,
0
};
if
((
cs
->
style
&
(
WS_CHILD
|
WS_POPUP
))
==
WS_CHILD
)
{
WARN
(
"No parent for child window
\n
"
);
...
...
@@ -1458,7 +1456,7 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
/* are we creating the desktop or HWND_MESSAGE parent itself? */
if
(
className
!=
(
LPCWSTR
)
DESKTOP_CLASS_ATOM
&&
(
IS_INTRESOURCE
(
className
)
||
wcsicmp
(
className
,
messageW
)))
(
IS_INTRESOURCE
(
className
)
||
wcsicmp
(
className
,
L"Message"
)))
{
DWORD
layout
;
GetProcessDefaultLayout
(
&
layout
);
...
...
@@ -2084,13 +2082,11 @@ HWND WINAPI GetDesktopWindow(void)
if
(
!
thread_info
->
top_window
)
{
static
const
WCHAR
explorer
[]
=
{
'\\'
,
'e'
,
'x'
,
'p'
,
'l'
,
'o'
,
'r'
,
'e'
,
'r'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
static
const
WCHAR
args
[]
=
{
' '
,
'/'
,
'd'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
0
};
STARTUPINFOW
si
;
PROCESS_INFORMATION
pi
;
WCHAR
windir
[
MAX_PATH
];
WCHAR
app
[
MAX_PATH
+
ARRAY_SIZE
(
explorer
)];
WCHAR
cmdline
[
MAX_PATH
+
ARRAY_SIZE
(
explorer
)
+
ARRAY_SIZE
(
args
)];
WCHAR
app
[
MAX_PATH
+
ARRAY_SIZE
(
L"
\\
explorer.exe"
)];
WCHAR
cmdline
[
MAX_PATH
+
ARRAY_SIZE
(
L"
\\
explorer.exe /desktop"
)];
WCHAR
desktop
[
MAX_PATH
];
void
*
redir
;
...
...
@@ -2120,9 +2116,9 @@ HWND WINAPI GetDesktopWindow(void)
GetSystemDirectoryW
(
windir
,
MAX_PATH
);
lstrcpyW
(
app
,
windir
);
lstrcatW
(
app
,
explorer
);
lstrcatW
(
app
,
L"
\\
explorer.exe"
);
lstrcpyW
(
cmdline
,
app
);
lstrcatW
(
cmdline
,
args
);
lstrcatW
(
cmdline
,
L" /desktop"
);
Wow64DisableWow64FsRedirection
(
&
redir
);
if
(
CreateProcessW
(
app
,
cmdline
,
NULL
,
NULL
,
FALSE
,
DETACHED_PROCESS
,
...
...
@@ -4054,11 +4050,6 @@ BOOL WINAPI GetProcessDefaultLayout( DWORD *layout )
}
if
(
process_layout
==
~
0u
)
{
static
const
WCHAR
translationW
[]
=
{
'\\'
,
'V'
,
'a'
,
'r'
,
'F'
,
'i'
,
'l'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
'\\'
,
'T'
,
'r'
,
'a'
,
'n'
,
's'
,
'l'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
filedescW
[]
=
{
'\\'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
'F'
,
'i'
,
'l'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
'\\'
,
'%'
,
'0'
,
'4'
,
'x'
,
'%'
,
'0'
,
'4'
,
'x'
,
'\\'
,
'F'
,
'i'
,
'l'
,
'e'
,
'D'
,
'e'
,
's'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
WCHAR
*
str
,
buffer
[
MAX_PATH
];
DWORD
i
,
len
,
version_layout
=
0
;
DWORD
user_lang
=
GetUserDefaultLangID
();
...
...
@@ -4069,7 +4060,7 @@ BOOL WINAPI GetProcessDefaultLayout( DWORD *layout )
if
(
!
(
len
=
GetFileVersionInfoSizeW
(
buffer
,
NULL
)))
goto
done
;
if
(
!
(
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
goto
done
;
if
(
!
GetFileVersionInfoW
(
buffer
,
0
,
len
,
data
))
goto
done
;
if
(
!
VerQueryValueW
(
data
,
translationW
,
(
void
**
)
&
languages
,
&
len
)
||
!
len
)
goto
done
;
if
(
!
VerQueryValueW
(
data
,
L"
\\
VarFileInfo
\\
Translation"
,
(
void
**
)
&
languages
,
&
len
)
||
!
len
)
goto
done
;
len
/=
sizeof
(
DWORD
);
for
(
i
=
0
;
i
<
len
;
i
++
)
if
(
LOWORD
(
languages
[
i
])
==
user_lang
)
break
;
...
...
@@ -4078,7 +4069,8 @@ BOOL WINAPI GetProcessDefaultLayout( DWORD *layout )
if
(
LOWORD
(
languages
[
i
])
==
MAKELANGID
(
PRIMARYLANGID
(
user_lang
),
SUBLANG_NEUTRAL
))
break
;
if
(
i
==
len
)
i
=
0
;
/* default to the first one */
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
filedescW
,
LOWORD
(
languages
[
i
]),
HIWORD
(
languages
[
i
])
);
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"
\\
StringFileInfo
\\
%04x%04x
\\
FileDescription"
,
LOWORD
(
languages
[
i
]),
HIWORD
(
languages
[
i
])
);
if
(
!
VerQueryValueW
(
data
,
buffer
,
(
void
**
)
&
str
,
&
len
))
goto
done
;
TRACE
(
"found description %s
\n
"
,
debugstr_w
(
str
));
if
(
str
[
0
]
==
0x200e
&&
str
[
1
]
==
0x200e
)
version_layout
=
LAYOUT_RTL
;
...
...
dlls/user32/winstation.c
View file @
5ad25c29
...
...
@@ -58,9 +58,6 @@ static BOOL CALLBACK enum_names_WtoA( LPWSTR name, LPARAM lparam )
static
HANDLE
get_winstations_dir_handle
(
void
)
{
static
HANDLE
handle
=
NULL
;
static
const
WCHAR
basenameW
[]
=
{
'\\'
,
'S'
,
'e'
,
's'
,
's'
,
'i'
,
'o'
,
'n'
,
's'
,
'\\'
,
'%'
,
'u'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
'S'
,
't'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
's'
,
0
};
WCHAR
buffer
[
64
];
UNICODE_STRING
str
;
OBJECT_ATTRIBUTES
attr
;
...
...
@@ -69,7 +66,7 @@ static HANDLE get_winstations_dir_handle(void)
{
HANDLE
dir
;
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
basenameW
,
NtCurrentTeb
()
->
Peb
->
SessionId
);
swprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"
\\
Sessions
\\
%u
\\
Windows
\\
WindowStations"
,
NtCurrentTeb
()
->
Peb
->
SessionId
);
RtlInitUnicodeString
(
&
str
,
buffer
);
InitializeObjectAttributes
(
&
attr
,
&
str
,
0
,
0
,
NULL
);
NtOpenDirectoryObject
(
&
dir
,
DIRECTORY_CREATE_OBJECT
|
DIRECTORY_TRAVERSE
,
&
attr
);
...
...
@@ -83,13 +80,12 @@ static WCHAR default_name[29];
static
BOOL
WINAPI
winstation_default_name_once
(
INIT_ONCE
*
once
,
void
*
param
,
void
**
context
)
{
static
const
WCHAR
fmt
[]
=
{
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'-'
,
'0'
,
'x'
,
'%'
,
'x'
,
'-'
,
'%'
,
'x'
,
'$'
,
0
};
TOKEN_STATISTICS
stats
;
BOOL
ret
;
ret
=
GetTokenInformation
(
GetCurrentProcessToken
(),
TokenStatistics
,
&
stats
,
sizeof
(
stats
),
NULL
);
if
(
ret
)
swprintf
(
default_name
,
ARRAY_SIZE
(
default_name
),
fmt
,
swprintf
(
default_name
,
ARRAY_SIZE
(
default_name
),
L"Service-0x%x-%x$"
,
stats
.
AuthenticationId
.
HighPart
,
stats
.
AuthenticationId
.
LowPart
);
return
ret
;
...
...
@@ -579,8 +575,6 @@ BOOL WINAPI GetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DW
*/
BOOL
WINAPI
GetUserObjectInformationW
(
HANDLE
handle
,
INT
index
,
LPVOID
info
,
DWORD
len
,
LPDWORD
needed
)
{
static
const
WCHAR
desktopW
[]
=
{
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
0
};
static
const
WCHAR
winstationW
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
'S'
,
't'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
BOOL
ret
;
switch
(
index
)
...
...
@@ -617,14 +611,14 @@ BOOL WINAPI GetUserObjectInformationW( HANDLE handle, INT index, LPVOID info, DW
ret
=
!
wine_server_call_err
(
req
);
if
(
ret
)
{
size_t
size
=
reply
->
is_desktop
?
sizeof
(
desktopW
)
:
sizeof
(
winstationW
);
size_t
size
=
reply
->
is_desktop
?
sizeof
(
L"Desktop"
)
:
sizeof
(
L"WindowStation"
);
if
(
needed
)
*
needed
=
size
;
if
(
len
<
size
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
ret
=
FALSE
;
}
else
memcpy
(
info
,
reply
->
is_desktop
?
desktopW
:
winstationW
,
size
);
else
memcpy
(
info
,
reply
->
is_desktop
?
L"Desktop"
:
L"WindowStation"
,
size
);
}
}
SERVER_END_REQ
;
...
...
dlls/user32/wsprintf.c
View file @
5ad25c29
...
...
@@ -75,9 +75,6 @@ typedef union {
LONGLONG
int_view
;
}
WPRINTF_DATA
;
static
const
CHAR
null_stringA
[]
=
"(null)"
;
static
const
WCHAR
null_stringW
[]
=
{
'('
,
'n'
,
'u'
,
'l'
,
'l'
,
')'
,
0
};
/***********************************************************************
* WPRINTF_ParseFormatA
*
...
...
@@ -261,7 +258,7 @@ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg,
else
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
&
arg
->
wchar_view
,
1
,
NULL
,
0
,
NULL
,
NULL
);
return
(
format
->
precision
=
len
);
case
WPR_STRING
:
if
(
!
arg
->
lpcstr_view
)
arg
->
lpcstr_view
=
null_stringA
;
if
(
!
arg
->
lpcstr_view
)
arg
->
lpcstr_view
=
"(null)"
;
if
(
dst_is_wide
)
{
LPCSTR
p
=
arg
->
lpcstr_view
;
...
...
@@ -281,7 +278,7 @@ static UINT WPRINTF_GetLen( WPRINTF_FORMAT *format, WPRINTF_DATA *arg,
if
(
len
>
maxlen
)
len
=
maxlen
;
return
(
format
->
precision
=
len
);
case
WPR_WSTRING
:
if
(
!
arg
->
lpcwstr_view
)
arg
->
lpcwstr_view
=
null_stringW
;
if
(
!
arg
->
lpcwstr_view
)
arg
->
lpcwstr_view
=
L"(null)"
;
if
(
dst_is_wide
)
{
for
(
len
=
0
;
!
format
->
precision
||
(
len
<
format
->
precision
);
len
++
)
...
...
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