4 * Copyright 2021 Jacek Caban for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_WIN32U_PRIVATE
22 #define __WINE_WIN32U_PRIVATE
30 #include "wine/gdi_driver.h"
31 #include "wine/unixlib.h"
32 #include "wine/debug.h"
33 #include "wine/server.h"
37 extern UINT
enum_clipboard_formats( UINT format
) DECLSPEC_HIDDEN
;
38 extern void release_clipboard_owner( HWND hwnd
) DECLSPEC_HIDDEN
;
41 extern HICON
alloc_cursoricon_handle( BOOL is_icon
) DECLSPEC_HIDDEN
;
42 extern ULONG_PTR
get_icon_param( HICON handle
) DECLSPEC_HIDDEN
;
43 extern ULONG_PTR
set_icon_param( HICON handle
, ULONG_PTR param
) DECLSPEC_HIDDEN
;
46 extern struct window_surface dummy_surface DECLSPEC_HIDDEN
;
47 extern BOOL
create_dib_surface( HDC hdc
, const BITMAPINFO
*info
) DECLSPEC_HIDDEN
;
48 extern void create_offscreen_window_surface( const RECT
*visible_rect
,
49 struct window_surface
**surface
) DECLSPEC_HIDDEN
;
50 extern void erase_now( HWND hwnd
, UINT rdw_flags
) DECLSPEC_HIDDEN
;
51 extern void flush_window_surfaces( BOOL idle
) DECLSPEC_HIDDEN
;
52 extern void move_window_bits( HWND hwnd
, struct window_surface
*old_surface
,
53 struct window_surface
*new_surface
,
54 const RECT
*visible_rect
, const RECT
*old_visible_rect
,
55 const RECT
*window_rect
, const RECT
*valid_rects
) DECLSPEC_HIDDEN
;
56 extern void move_window_bits_parent( HWND hwnd
, HWND parent
, const RECT
*window_rect
,
57 const RECT
*valid_rects
) DECLSPEC_HIDDEN
;
58 extern void register_window_surface( struct window_surface
*old
,
59 struct window_surface
*new ) DECLSPEC_HIDDEN
;
62 extern LRESULT
default_window_proc( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
,
63 BOOL ansi
) DECLSPEC_HIDDEN
;
64 extern LRESULT
desktop_window_proc( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
) DECLSPEC_HIDDEN
;
65 extern BOOL
draw_menu_button( HWND hwnd
, HDC dc
, RECT
*r
, enum NONCLIENT_BUTTON_TYPE
, BOOL down
, BOOL grayed
) DECLSPEC_HIDDEN
;
66 extern BOOL
draw_frame_menu( HDC dc
, RECT
*r
, UINT flags
) DECLSPEC_HIDDEN
;
67 extern BOOL
draw_nc_sys_button( HWND hwnd
, HDC hdc
, BOOL down
) DECLSPEC_HIDDEN
;
68 extern BOOL
draw_rect_edge( HDC hdc
, RECT
*rc
, UINT uType
, UINT uFlags
, UINT width
) DECLSPEC_HIDDEN
;
69 extern void fill_rect( HDC dc
, const RECT
*rect
, HBRUSH hbrush
) DECLSPEC_HIDDEN
;
70 extern void get_sys_popup_pos( HWND hwnd
, RECT
*rect
) DECLSPEC_HIDDEN
;
71 extern LRESULT
handle_nc_hit_test( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
74 extern LRESULT
call_current_hook( HHOOK hhook
, INT code
, WPARAM wparam
, LPARAM lparam
) DECLSPEC_HIDDEN
;
75 extern LRESULT
call_hooks( INT id
, INT code
, WPARAM wparam
, LPARAM lparam
,
76 size_t lparam_size
) DECLSPEC_HIDDEN
;
77 extern BOOL
is_hooked( INT id
) DECLSPEC_HIDDEN
;
78 extern BOOL
unhook_windows_hook( INT id
, HOOKPROC proc
) DECLSPEC_HIDDEN
;
81 extern void cleanup_imm_thread(void) DECLSPEC_HIDDEN
;
82 extern HWND
get_default_ime_window( HWND hwnd
) DECLSPEC_HIDDEN
;
83 extern HIMC
get_default_input_context(void) DECLSPEC_HIDDEN
;
84 extern HIMC
get_window_input_context( HWND hwnd
) DECLSPEC_HIDDEN
;
85 extern BOOL
register_imm_window( HWND hwnd
) DECLSPEC_HIDDEN
;
86 extern void unregister_imm_window( HWND hwnd
) DECLSPEC_HIDDEN
;
89 extern BOOL
destroy_caret(void) DECLSPEC_HIDDEN
;
90 extern LONG global_key_state_counter DECLSPEC_HIDDEN
;
91 extern HWND
get_active_window(void) DECLSPEC_HIDDEN
;
92 extern HWND
get_capture(void) DECLSPEC_HIDDEN
;
93 extern BOOL
get_cursor_pos( POINT
*pt
) DECLSPEC_HIDDEN
;
94 extern HWND
get_focus(void) DECLSPEC_HIDDEN
;
95 extern DWORD
get_input_state(void) DECLSPEC_HIDDEN
;
96 extern BOOL
release_capture(void) DECLSPEC_HIDDEN
;
97 extern BOOL
set_capture_window( HWND hwnd
, UINT gui_flags
, HWND
*prev_ret
) DECLSPEC_HIDDEN
;
98 extern BOOL
set_caret_blink_time( unsigned int time
) DECLSPEC_HIDDEN
;
99 extern BOOL
set_caret_pos( int x
, int y
) DECLSPEC_HIDDEN
;
100 extern BOOL
set_foreground_window( HWND hwnd
, BOOL mouse
) DECLSPEC_HIDDEN
;
101 extern void toggle_caret( HWND hwnd
) DECLSPEC_HIDDEN
;
102 extern void update_mouse_tracking_info( HWND hwnd
) DECLSPEC_HIDDEN
;
103 extern BOOL
get_clip_cursor( RECT
*rect
) DECLSPEC_HIDDEN
;
104 extern BOOL
process_wine_clipcursor( BOOL empty
) DECLSPEC_HIDDEN
;
107 extern HMENU
create_menu( BOOL is_popup
) DECLSPEC_HIDDEN
;
108 extern BOOL
draw_menu_bar( HWND hwnd
) DECLSPEC_HIDDEN
;
109 extern UINT
draw_nc_menu_bar( HDC hdc
, RECT
*rect
, HWND hwnd
) DECLSPEC_HIDDEN
;
110 extern void end_menu( HWND hwnd
) DECLSPEC_HIDDEN
;
111 extern HMENU
get_menu( HWND hwnd
) DECLSPEC_HIDDEN
;
112 extern UINT
get_menu_bar_height( HWND hwnd
, UINT width
, INT org_x
, INT org_y
) DECLSPEC_HIDDEN
;
113 extern BOOL
get_menu_info( HMENU handle
, MENUINFO
*info
) DECLSPEC_HIDDEN
;
114 extern INT
get_menu_item_count( HMENU handle
) DECLSPEC_HIDDEN
;
115 extern UINT
get_menu_state( HMENU handle
, UINT item_id
, UINT flags
) DECLSPEC_HIDDEN
;
116 extern HMENU
get_window_sys_sub_menu( HWND hwnd
) DECLSPEC_HIDDEN
;
117 extern BOOL
is_menu( HMENU handle
) DECLSPEC_HIDDEN
;
118 extern HWND
is_menu_active(void) DECLSPEC_HIDDEN
;
119 extern LRESULT
popup_menu_window_proc( HWND hwnd
, UINT message
, WPARAM wparam
,
120 LPARAM lparam
) DECLSPEC_HIDDEN
;
121 extern BOOL
set_window_menu( HWND hwnd
, HMENU handle
) DECLSPEC_HIDDEN
;
122 extern void track_keyboard_menu_bar( HWND hwnd
, UINT wparam
, WCHAR ch
) DECLSPEC_HIDDEN
;
123 extern void track_mouse_menu_bar( HWND hwnd
, INT ht
, int x
, int y
) DECLSPEC_HIDDEN
;
126 extern BOOL
kill_system_timer( HWND hwnd
, UINT_PTR id
) DECLSPEC_HIDDEN
;
127 extern BOOL
reply_message_result( LRESULT result
) DECLSPEC_HIDDEN
;
128 extern NTSTATUS
send_hardware_message( HWND hwnd
, const INPUT
*input
, const RAWINPUT
*rawinput
,
129 UINT flags
) DECLSPEC_HIDDEN
;
130 extern LRESULT
send_internal_message_timeout( DWORD dest_pid
, DWORD dest_tid
, UINT msg
, WPARAM wparam
,
131 LPARAM lparam
, UINT flags
, UINT timeout
,
132 PDWORD_PTR res_ptr
) DECLSPEC_HIDDEN
;
133 extern LRESULT
send_message( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
) DECLSPEC_HIDDEN
;
134 extern BOOL
send_notify_message( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
, BOOL ansi
) DECLSPEC_HIDDEN
;
135 extern LRESULT
send_message_timeout( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
,
136 UINT flags
, UINT timeout
, BOOL ansi
) DECLSPEC_HIDDEN
;
139 extern BOOL
process_rawinput_message( MSG
*msg
, UINT hw_id
, const struct hardware_msg_data
*msg_data
) DECLSPEC_HIDDEN
;
140 extern BOOL
rawinput_device_get_usages( HANDLE handle
, USHORT
*usage_page
, USHORT
*usage
) DECLSPEC_HIDDEN
;
143 extern void draw_nc_scrollbar( HWND hwnd
, HDC hdc
, BOOL draw_horizontal
, BOOL draw_vertical
) DECLSPEC_HIDDEN
;
144 extern BOOL
get_scroll_info( HWND hwnd
, INT bar
, SCROLLINFO
*info
) DECLSPEC_HIDDEN
;
145 extern void handle_scroll_event( HWND hwnd
, INT bar
, UINT msg
, POINT pt
) DECLSPEC_HIDDEN
;
146 extern LRESULT
scroll_bar_window_proc( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
,
147 BOOL ansi
) DECLSPEC_HIDDEN
;
148 extern void set_standard_scroll_painted( HWND hwnd
, int bar
, BOOL painted
) DECLSPEC_HIDDEN
;
149 extern void track_scroll_bar( HWND hwnd
, int scrollbar
, POINT pt
) DECLSPEC_HIDDEN
;
152 extern BOOL enable_thunk_lock DECLSPEC_HIDDEN
;
153 extern HBRUSH
get_55aa_brush(void) DECLSPEC_HIDDEN
;
154 extern DWORD
get_dialog_base_units(void) DECLSPEC_HIDDEN
;
155 extern LONG
get_char_dimensions( HDC hdc
, TEXTMETRICW
*metric
, int *height
) DECLSPEC_HIDDEN
;
156 extern INT
get_display_depth( UNICODE_STRING
*name
) DECLSPEC_HIDDEN
;
157 extern RECT
get_display_rect( const WCHAR
*display
) DECLSPEC_HIDDEN
;
158 extern UINT
get_monitor_dpi( HMONITOR monitor
) DECLSPEC_HIDDEN
;
159 extern BOOL
get_monitor_info( HMONITOR handle
, MONITORINFO
*info
) DECLSPEC_HIDDEN
;
160 extern UINT
get_win_monitor_dpi( HWND hwnd
) DECLSPEC_HIDDEN
;
161 extern RECT
get_primary_monitor_rect( UINT dpi
) DECLSPEC_HIDDEN
;
162 extern DWORD
get_process_layout(void) DECLSPEC_HIDDEN
;
163 extern COLORREF
get_sys_color( int index
) DECLSPEC_HIDDEN
;
164 extern HBRUSH
get_sys_color_brush( unsigned int index
) DECLSPEC_HIDDEN
;
165 extern HPEN
get_sys_color_pen( unsigned int index
) DECLSPEC_HIDDEN
;
166 extern UINT
get_system_dpi(void) DECLSPEC_HIDDEN
;
167 extern int get_system_metrics( int index
) DECLSPEC_HIDDEN
;
168 extern UINT
get_thread_dpi(void) DECLSPEC_HIDDEN
;
169 extern DPI_AWARENESS
get_thread_dpi_awareness(void) DECLSPEC_HIDDEN
;
170 extern RECT
get_virtual_screen_rect( UINT dpi
) DECLSPEC_HIDDEN
;
171 extern BOOL
is_exiting_thread( DWORD tid
) DECLSPEC_HIDDEN
;
172 extern POINT
map_dpi_point( POINT pt
, UINT dpi_from
, UINT dpi_to
) DECLSPEC_HIDDEN
;
173 extern RECT
map_dpi_rect( RECT rect
, UINT dpi_from
, UINT dpi_to
) DECLSPEC_HIDDEN
;
174 extern BOOL
message_beep( UINT i
) DECLSPEC_HIDDEN
;
175 extern POINT
point_phys_to_win_dpi( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
176 extern POINT
point_thread_to_win_dpi( HWND hwnd
, POINT pt
) DECLSPEC_HIDDEN
;
177 extern RECT
rect_thread_to_win_dpi( HWND hwnd
, RECT rect
) DECLSPEC_HIDDEN
;
178 extern HMONITOR
monitor_from_point( POINT pt
, UINT flags
, UINT dpi
) DECLSPEC_HIDDEN
;
179 extern HMONITOR
monitor_from_rect( const RECT
*rect
, UINT flags
, UINT dpi
) DECLSPEC_HIDDEN
;
180 extern HMONITOR
monitor_from_window( HWND hwnd
, UINT flags
, UINT dpi
) DECLSPEC_HIDDEN
;
181 extern void user_lock(void) DECLSPEC_HIDDEN
;
182 extern void user_unlock(void) DECLSPEC_HIDDEN
;
183 extern void user_check_not_lock(void) DECLSPEC_HIDDEN
;
187 extern HDWP
begin_defer_window_pos( INT count
) DECLSPEC_HIDDEN
;
188 extern BOOL
client_to_screen( HWND hwnd
, POINT
*pt
) DECLSPEC_HIDDEN
;
189 extern void destroy_thread_windows(void) DECLSPEC_HIDDEN
;
190 extern LRESULT
destroy_window( HWND hwnd
) DECLSPEC_HIDDEN
;
191 extern BOOL
enable_window( HWND hwnd
, BOOL enable
) DECLSPEC_HIDDEN
;
192 extern BOOL
get_client_rect( HWND hwnd
, RECT
*rect
) DECLSPEC_HIDDEN
;
193 extern HWND
get_desktop_window(void) DECLSPEC_HIDDEN
;
194 extern UINT
get_dpi_for_window( HWND hwnd
) DECLSPEC_HIDDEN
;
195 extern HWND
get_full_window_handle( HWND hwnd
) DECLSPEC_HIDDEN
;
196 extern HWND
get_parent( HWND hwnd
) DECLSPEC_HIDDEN
;
197 extern HWND
get_hwnd_message_parent(void) DECLSPEC_HIDDEN
;
198 extern DPI_AWARENESS_CONTEXT
get_window_dpi_awareness_context( HWND hwnd
) DECLSPEC_HIDDEN
;
199 extern MINMAXINFO
get_min_max_info( HWND hwnd
) DECLSPEC_HIDDEN
;
200 extern DWORD
get_window_context_help_id( HWND hwnd
) DECLSPEC_HIDDEN
;
201 extern HWND
get_window_relative( HWND hwnd
, UINT rel
) DECLSPEC_HIDDEN
;
202 extern DWORD
get_window_thread( HWND hwnd
, DWORD
*process
) DECLSPEC_HIDDEN
;
203 extern HWND
is_current_process_window( HWND hwnd
) DECLSPEC_HIDDEN
;
204 extern HWND
is_current_thread_window( HWND hwnd
) DECLSPEC_HIDDEN
;
205 extern BOOL
is_desktop_window( HWND hwnd
) DECLSPEC_HIDDEN
;
206 extern BOOL
is_iconic( HWND hwnd
) DECLSPEC_HIDDEN
;
207 extern BOOL
is_window_drawable( HWND hwnd
, BOOL icon
) DECLSPEC_HIDDEN
;
208 extern BOOL
is_window_enabled( HWND hwnd
) DECLSPEC_HIDDEN
;
209 extern BOOL
is_window_unicode( HWND hwnd
) DECLSPEC_HIDDEN
;
210 extern BOOL
is_window_visible( HWND hwnd
) DECLSPEC_HIDDEN
;
211 extern BOOL
is_zoomed( HWND hwnd
) DECLSPEC_HIDDEN
;
212 extern DWORD
get_window_long( HWND hwnd
, INT offset
) DECLSPEC_HIDDEN
;
213 extern ULONG_PTR
get_window_long_ptr( HWND hwnd
, INT offset
, BOOL ansi
) DECLSPEC_HIDDEN
;
214 extern BOOL
get_window_rect( HWND hwnd
, RECT
*rect
, UINT dpi
) DECLSPEC_HIDDEN
;
215 enum coords_relative
;
216 extern BOOL
get_window_rects( HWND hwnd
, enum coords_relative relative
, RECT
*window_rect
,
217 RECT
*client_rect
, UINT dpi
) DECLSPEC_HIDDEN
;
218 extern HWND
*list_window_children( HDESK desktop
, HWND hwnd
, UNICODE_STRING
*class,
219 DWORD tid
) DECLSPEC_HIDDEN
;
220 extern int map_window_points( HWND hwnd_from
, HWND hwnd_to
, POINT
*points
, UINT count
,
221 UINT dpi
) DECLSPEC_HIDDEN
;
222 extern void map_window_region( HWND from
, HWND to
, HRGN hrgn
) DECLSPEC_HIDDEN
;
223 extern BOOL
screen_to_client( HWND hwnd
, POINT
*pt
) DECLSPEC_HIDDEN
;
224 extern LONG_PTR
set_window_long( HWND hwnd
, INT offset
, UINT size
, LONG_PTR newval
,
225 BOOL ansi
) DECLSPEC_HIDDEN
;
226 extern BOOL
set_window_pos( WINDOWPOS
*winpos
, int parent_x
, int parent_y
) DECLSPEC_HIDDEN
;
227 extern ULONG
set_window_style( HWND hwnd
, ULONG set_bits
, ULONG clear_bits
) DECLSPEC_HIDDEN
;
228 extern BOOL
show_owned_popups( HWND owner
, BOOL show
) DECLSPEC_HIDDEN
;
229 extern void update_window_state( HWND hwnd
) DECLSPEC_HIDDEN
;
230 extern HWND
window_from_point( HWND hwnd
, POINT pt
, INT
*hittest
) DECLSPEC_HIDDEN
;
231 extern HWND
get_shell_window(void) DECLSPEC_HIDDEN
;
232 extern HWND
get_progman_window(void) DECLSPEC_HIDDEN
;
233 extern HWND
set_progman_window( HWND hwnd
) DECLSPEC_HIDDEN
;
234 extern HWND
get_taskman_window(void) DECLSPEC_HIDDEN
;
235 extern HWND
set_taskman_window( HWND hwnd
) DECLSPEC_HIDDEN
;
237 /* to release pointers retrieved by win_get_ptr */
238 static inline void release_win_ptr( struct tagWND
*ptr
)
243 extern void gdi_init(void) DECLSPEC_HIDDEN
;
244 extern void winstation_init(void) DECLSPEC_HIDDEN
;
245 extern void sysparams_init(void) DECLSPEC_HIDDEN
;
246 extern int muldiv( int a
, int b
, int c
) DECLSPEC_HIDDEN
;
248 extern HKEY
reg_create_key( HKEY root
, const WCHAR
*name
, ULONG name_len
,
249 DWORD options
, DWORD
*disposition
) DECLSPEC_HIDDEN
;
250 extern HKEY
reg_open_hkcu_key( const char *name
) DECLSPEC_HIDDEN
;
251 extern HKEY
reg_open_key( HKEY root
, const WCHAR
*name
, ULONG name_len
) DECLSPEC_HIDDEN
;
252 extern ULONG
query_reg_value( HKEY hkey
, const WCHAR
*name
,
253 KEY_VALUE_PARTIAL_INFORMATION
*info
, ULONG size
) DECLSPEC_HIDDEN
;
254 extern ULONG
query_reg_ascii_value( HKEY hkey
, const char *name
,
255 KEY_VALUE_PARTIAL_INFORMATION
*info
, ULONG size
) DECLSPEC_HIDDEN
;
256 extern void set_reg_ascii_value( HKEY hkey
, const char *name
, const char *value
) DECLSPEC_HIDDEN
;
257 extern BOOL
set_reg_value( HKEY hkey
, const WCHAR
*name
, UINT type
, const void *value
,
258 DWORD count
) DECLSPEC_HIDDEN
;
259 extern BOOL
reg_delete_tree( HKEY parent
, const WCHAR
*name
, ULONG name_len
) DECLSPEC_HIDDEN
;
260 extern void reg_delete_value( HKEY hkey
, const WCHAR
*name
) DECLSPEC_HIDDEN
;
262 extern HKEY hkcu_key DECLSPEC_HIDDEN
;
264 extern const struct user_driver_funcs
*user_driver DECLSPEC_HIDDEN
;
266 static inline BOOL
set_ntstatus( NTSTATUS status
)
268 if (status
) RtlSetLastWin32Error( RtlNtStatusToDosError( status
));
272 static inline WCHAR
win32u_towupper( WCHAR ch
)
274 return RtlUpcaseUnicodeChar( ch
);
277 extern CPTABLEINFO ansi_cp DECLSPEC_HIDDEN
;
279 CPTABLEINFO
*get_cptable( WORD cp
) DECLSPEC_HIDDEN
;
280 const NLS_LOCALE_DATA
*get_locale_data( LCID lcid
) DECLSPEC_HIDDEN
;
281 extern BOOL
translate_charset_info( DWORD
*src
, CHARSETINFO
*cs
, DWORD flags
) DECLSPEC_HIDDEN
;
282 DWORD
win32u_mbtowc( CPTABLEINFO
*info
, WCHAR
*dst
, DWORD dstlen
, const char *src
,
283 DWORD srclen
) DECLSPEC_HIDDEN
;
284 DWORD
win32u_wctomb( CPTABLEINFO
*info
, char *dst
, DWORD dstlen
, const WCHAR
*src
,
285 DWORD srclen
) DECLSPEC_HIDDEN
;
286 DWORD
win32u_wctomb_size( CPTABLEINFO
*info
, const WCHAR
*src
, DWORD srclen
) DECLSPEC_HIDDEN
;
287 DWORD
win32u_mbtowc_size( CPTABLEINFO
*info
, const char *src
, DWORD srclen
) DECLSPEC_HIDDEN
;
289 static inline WCHAR
*win32u_wcsdup( const WCHAR
*str
)
291 DWORD size
= (lstrlenW( str
) + 1) * sizeof(WCHAR
);
292 WCHAR
*ret
= malloc( size
);
293 if (ret
) memcpy( ret
, str
, size
);
297 static inline WCHAR
*towstr( const char *str
)
299 DWORD len
= strlen( str
) + 1;
300 WCHAR
*ret
= malloc( len
* sizeof(WCHAR
) );
301 if (ret
) win32u_mbtowc( &ansi_cp
, ret
, len
, str
, len
);
305 #define towupper(c) win32u_towupper(c)
306 #define wcsdup(s) win32u_wcsdup(s)
308 static inline void ascii_to_unicode( WCHAR
*dst
, const char *src
, size_t len
)
310 while (len
--) *dst
++ = (unsigned char)*src
++;
313 static inline UINT
asciiz_to_unicode( WCHAR
*dst
, const char *src
)
316 while ((*p
++ = *src
++));
317 return (p
- dst
) * sizeof(WCHAR
);
320 static inline BOOL
is_win9x(void)
322 return NtCurrentTeb()->Peb
->OSPlatformId
== VER_PLATFORM_WIN32s
;
325 static inline ULONG_PTR
zero_bits(void)
328 return !NtCurrentTeb()->WowTebOffset
? 0 : 0x7fffffff;
334 static inline const char *debugstr_us( const UNICODE_STRING
*us
)
336 if (!us
) return "<null>";
337 return debugstr_wn( us
->Buffer
, us
->Length
/ sizeof(WCHAR
) );
340 static inline const char *debugstr_color( COLORREF color
)
342 if (color
& (1 << 24)) /* PALETTEINDEX */
343 return wine_dbg_sprintf( "PALETTEINDEX(%u)", LOWORD(color
) );
344 if (color
>> 16 == 0x10ff) /* DIBINDEX */
345 return wine_dbg_sprintf( "DIBINDEX(%u)", LOWORD(color
) );
346 return wine_dbg_sprintf( "RGB(%02x,%02x,%02x)", GetRValue(color
), GetGValue(color
), GetBValue(color
) );
349 #endif /* __WINE_WIN32U_PRIVATE */