Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
April 2019
- 82 participants
- 1927 messages
[PATCH vkd3d 1/6] vkd3d-shader: Fix SV_Position.w in pixel shaders.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
libs/vkd3d-shader/spirv.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index f8ba598ffbf0..6cacf7c4b8d3 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -1158,6 +1158,12 @@ static uint32_t vkd3d_spirv_build_op_composite_insert(struct vkd3d_spirv_builder
result_type, object_id, composite_id, indexes, index_count);
}
+static uint32_t vkd3d_spirv_build_op_composite_insert1(struct vkd3d_spirv_builder *builder,
+ uint32_t result_type, uint32_t object_id, uint32_t composite_id, uint32_t index)
+{
+ return vkd3d_spirv_build_op_composite_insert(builder, result_type, object_id, composite_id, &index, 1);
+}
+
static uint32_t vkd3d_spirv_build_op_load(struct vkd3d_spirv_builder *builder,
uint32_t result_type, uint32_t pointer_id, uint32_t memory_access)
{
@@ -3215,6 +3221,21 @@ static uint32_t sv_front_face_fixup(struct vkd3d_dxbc_compiler *compiler,
return vkd3d_dxbc_compiler_emit_bool_to_int(compiler, 1, front_facing_id);
}
+/* frag_coord.w = 1.0f / frag_coord.w */
+static uint32_t frag_coord_fixup(struct vkd3d_dxbc_compiler *compiler,
+ uint32_t frag_coord_id)
+{
+ struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
+ uint32_t type_id, w_id;
+
+ type_id = vkd3d_spirv_get_type_id(builder, VKD3D_TYPE_FLOAT, 1);
+ w_id = vkd3d_spirv_build_op_composite_extract1(builder, type_id, frag_coord_id, 3);
+ w_id = vkd3d_spirv_build_op_fdiv(builder, type_id,
+ vkd3d_dxbc_compiler_get_constant_float(compiler, 1.0f), w_id);
+ type_id = vkd3d_spirv_get_type_id(builder, VKD3D_TYPE_FLOAT, VKD3D_VEC4_SIZE);
+ return vkd3d_spirv_build_op_composite_insert1(builder, type_id, w_id, frag_coord_id, 3);
+}
+
struct vkd3d_spirv_builtin
{
enum vkd3d_component_type component_type;
@@ -3273,7 +3294,7 @@ vkd3d_system_value_builtins[] =
};
static const struct vkd3d_spirv_builtin vkd3d_pixel_shader_position_builtin =
{
- VKD3D_TYPE_FLOAT, 4, SpvBuiltInFragCoord,
+ VKD3D_TYPE_FLOAT, 4, SpvBuiltInFragCoord, frag_coord_fixup,
};
static const struct
{
@@ -6906,8 +6927,8 @@ static void vkd3d_dxbc_compiler_emit_sample_c(struct vkd3d_dxbc_compiler *compil
dref_id = vkd3d_dxbc_compiler_emit_load_src(compiler, &src[3], VKD3DSP_WRITEMASK_0);
/* XXX: Nvidia is broken and expects that the D_ref is packed together with coordinates. */
type_id = vkd3d_spirv_get_type_id(builder, VKD3D_TYPE_FLOAT, VKD3D_VEC4_SIZE);
- coordinate_id = vkd3d_spirv_build_op_composite_insert(builder,
- type_id, dref_id, coordinate_id, &image.resource_type_info->coordinate_component_count, 1);
+ coordinate_id = vkd3d_spirv_build_op_composite_insert1(builder,
+ type_id, dref_id, coordinate_id, image.resource_type_info->coordinate_component_count);
val_id = vkd3d_spirv_build_op_image_sample_dref(builder, op, sampled_type_id,
image.sampled_image_id, coordinate_id, dref_id, operands_mask,
image_operands, image_operand_count);
--
2.19.2
April 1, 2019
Re: [PATCH v2 2/4] shell32/autocomplete: Encapsulate the listbox into an owner window
by Huw Davies
On Thu, Mar 28, 2019 at 02:24:30PM +0200, Gabriel Ivăncescu wrote:
> Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
> ---
> dlls/shell32/autocomplete.c | 69 +++++++++++++++++++++++++++----------
> 1 file changed, 51 insertions(+), 18 deletions(-)
>
This doesn't look good:
../../../tools/runtest -q -P wine -T ../../.. -M shell32.dll -p shell32_test.exe.so autocomplete && touch autocomplete.ok
0009:fixme:msg:pack_message msg 138 (WM_CTLCOLORSTATIC) not supported yet
0009:err:win:DefWindowProcW called for other process window 0x10020
Huw.
April 1, 2019
Re: [PATCH] gdi32: Reformat some strings to improve readability
by Zhiyi Zhang
u"string" syntax is C++11. I think c89 is the standard we want to use.
On 4/1/19 3:35 PM, Michael Stefaniuc wrote:
> Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
> ---
> No-op as gcc generates the exact same object files.
> Only gdiobj.c, font.c and freetype.c need "CFLAGS=-O2 -g0 -DNDEBUG" as
> they use asserts and the line count changes.
>
>
>
> dlls/gdi32/dc.c | 2 +-
> dlls/gdi32/driver.c | 12 +--
> dlls/gdi32/enhmetafile.c | 2 +-
> dlls/gdi32/enhmfdrv/init.c | 2 +-
> dlls/gdi32/font.c | 34 +++-----
> dlls/gdi32/freetype.c | 165 +++++++++++++++----------------------
> dlls/gdi32/gdiobj.c | 128 ++++++++++++++--------------
> dlls/gdi32/opengl.c | 2 +-
> dlls/gdi32/region.c | 2 +-
> 9 files changed, 151 insertions(+), 198 deletions(-)
>
> diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
> index 8ee8a52d94..159e8436f0 100644
> --- a/dlls/gdi32/dc.c
> +++ b/dlls/gdi32/dc.c
> @@ -36,7 +36,7 @@
>
> WINE_DEFAULT_DEBUG_CHANNEL(dc);
>
> -static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
> +static const WCHAR displayW[] = u"display";
>
> static BOOL DC_DeleteObject( HGDIOBJ handle );
>
> diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c
> index 054d7cf418..7dd025813c 100644
> --- a/dlls/gdi32/driver.c
> +++ b/dlls/gdi32/driver.c
> @@ -125,8 +125,8 @@ const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name )
> {
> HMODULE module;
> struct graphics_driver *driver, *new_driver;
> - static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
> - static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
> + static const WCHAR displayW[] = u"display";
> + static const WCHAR display1W[] = u"\\\\.\\DISPLAY1";
>
> /* display driver is a special case */
> if (!strcmpiW( name, displayW ) || !strcmpiW( name, display1W )) return get_display_driver();
> @@ -858,10 +858,10 @@ const struct gdi_dc_funcs null_driver =
> */
> BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size )
> {
> - static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
> - static const WCHAR devicesW[] = { 'd','e','v','i','c','e','s',0 };
> - static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
> - static const WCHAR empty_strW[] = { 0 };
> + static const WCHAR displayW[] = u"display";
> + static const WCHAR devicesW[] = u"devices";
> + static const WCHAR display1W[] = u"\\\\.\\DISPLAY1";
> + static const WCHAR empty_strW[] = u"";
> WCHAR *p;
>
> /* display is a special case */
> diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c
> index a3360c269a..ff669470d1 100644
> --- a/dlls/gdi32/enhmetafile.c
> +++ b/dlls/gdi32/enhmetafile.c
> @@ -2810,7 +2810,7 @@ typedef struct wmf_in_emf_comment
> HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, const BYTE *lpbBuffer, HDC hdcRef,
> const METAFILEPICT *lpmfp)
> {
> - static const WCHAR szDisplayW[] = { 'D','I','S','P','L','A','Y','\0' };
> + static const WCHAR szDisplayW[] = u"DISPLAY";
> HMETAFILE hmf = NULL;
> HENHMETAFILE ret = NULL;
> HDC hdc = NULL, hdcdisp = NULL;
> diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c
> index 51133705a5..2e47455bdc 100644
> --- a/dlls/gdi32/enhmfdrv/init.c
> +++ b/dlls/gdi32/enhmfdrv/init.c
> @@ -329,7 +329,7 @@ HDC WINAPI CreateEnhMetaFileW(
> LPCWSTR description /* [in] optional description */
> )
> {
> - static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0};
> + static const WCHAR displayW[] = u"DISPLAY";
> HDC ret, ref_dc;
> DC *dc;
> EMFDRV_PDEVICE *physDev;
> diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
> index b3d67ff624..14f432f34c 100644
> --- a/dlls/gdi32/font.c
> +++ b/dlls/gdi32/font.c
> @@ -278,8 +278,7 @@ static DWORD get_key_value( HKEY key, const WCHAR *name, DWORD *value )
>
> static UINT get_subpixel_orientation( HKEY key )
> {
> - static const WCHAR smoothing_orientation[] = {'F','o','n','t','S','m','o','o','t','h','i','n','g',
> - 'O','r','i','e','n','t','a','t','i','o','n',0};
> + static const WCHAR smoothing_orientation[] = u"FontSmoothingOrientation";
> DWORD orient;
>
> /* FIXME: handle vertical orientations even though Windows doesn't */
> @@ -297,8 +296,8 @@ static UINT get_subpixel_orientation( HKEY key )
>
> static UINT get_default_smoothing( HKEY key )
> {
> - static const WCHAR smoothing[] = {'F','o','n','t','S','m','o','o','t','h','i','n','g',0};
> - static const WCHAR smoothing_type[] = {'F','o','n','t','S','m','o','o','t','h','i','n','g','T','y','p','e',0};
> + static const WCHAR smoothing[] = u"FontSmoothing";
> + static const WCHAR smoothing_type[] = u"FontSmoothingType";
> DWORD enabled, type;
>
> if (get_key_value( key, smoothing, &enabled )) return 0;
> @@ -635,14 +634,11 @@ static DWORD get_associated_charset_info(void)
>
> if (associated_charset == -1)
> {
> - static const WCHAR assoc_charset_reg_keyW[] = {'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','\\','F','o','n','t','A','s','s','o','c','\\',
> - 'A','s','s','o','c','i','a','t','e','d',' ','C','h','a','r','s','e','t','\0'};
> - static const WCHAR ansiW[] = {'A','N','S','I','(','0','0',')','\0'};
> - static const WCHAR oemW[] = {'O','E','M','(','F','F',')','\0'};
> - static const WCHAR symbolW[] = {'S','Y','M','B','O','L','(','0','2',')','\0'};
> - static const WCHAR yesW[] = {'Y','E','S','\0'};
> + static const WCHAR assoc_charset_reg_keyW[] = u"System\\CurrentControlSet\\Control\\FontAssoc\\Associated Charset";
> + static const WCHAR ansiW[] = u"ANSI(00)";
> + static const WCHAR oemW[] = u"OEM(FF)";
> + static const WCHAR symbolW[] = u"SYMBOL(02)";
> + static const WCHAR yesW[] = u"YES";
> HKEY hkey;
> WCHAR dataW[32];
> DWORD type, data_len;
> @@ -731,10 +727,8 @@ static void update_font_code_page( DC *dc, HANDLE font )
>
> static struct font_gamma_ramp *get_font_gamma_ramp( void )
> {
> - static const WCHAR desktopW[] = { 'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
> - 'D','e','s','k','t','o','p',0 };
> - static const WCHAR smoothing_gamma[] = { 'F','o','n','t','S','m','o','o','t','h','i','n','g',
> - 'G','a','m','m','a',0 };
> + static const WCHAR desktopW[] = u"Control Panel\\Desktop";
> + static const WCHAR smoothing_gamma[] = u"FontSmoothingGamma";
> const DWORD gamma_default = 1400;
> struct font_gamma_ramp *ramp;
> DWORD i, gamma;
> @@ -863,8 +857,7 @@ static BOOL FONT_DeleteObject( HGDIOBJ handle )
> */
> HFONT nulldrv_SelectFont( PHYSDEV dev, HFONT font, UINT *aa_flags )
> {
> - static const WCHAR desktopW[] = { 'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
> - 'D','e','s','k','t','o','p',0 };
> + static const WCHAR desktopW[] = u"Control Panel\\Desktop";
> static int orientation = -1, smoothing = -1;
> LOGFONTW lf;
> HKEY key;
> @@ -3810,10 +3803,7 @@ UINT WINAPI GetTextCharset(HDC hdc)
> LONG WINAPI GdiGetCharDimensions(HDC hdc, LPTEXTMETRICW lptm, LONG *height)
> {
> SIZE sz;
> - static const WCHAR alphabet[] = {
> - 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
> - 'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
> - 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
> + static const WCHAR alphabet[] = u"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
>
> if(lptm && !GetTextMetricsW(hdc, lptm)) return 0;
>
> diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
> index 333856e325..0ada635fea 100644
> --- a/dlls/gdi32/freetype.c
> +++ b/dlls/gdi32/freetype.c
> @@ -484,21 +484,13 @@ static inline struct freetype_physdev *get_freetype_dev( PHYSDEV dev )
>
> static const struct gdi_dc_funcs freetype_funcs;
>
> -static const WCHAR fontsW[] = {'\\','f','o','n','t','s','\0'};
> -static const WCHAR win9x_font_reg_key[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
> - 'W','i','n','d','o','w','s','\\',
> - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
> - 'F','o','n','t','s','\0'};
> -
> -static const WCHAR winnt_font_reg_key[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
> - 'W','i','n','d','o','w','s',' ','N','T','\\',
> - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
> - 'F','o','n','t','s','\0'};
> -
> -static const WCHAR system_fonts_reg_key[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
> -static const WCHAR FixedSys_Value[] = {'F','I','X','E','D','F','O','N','.','F','O','N','\0'};
> -static const WCHAR System_Value[] = {'F','O','N','T','S','.','F','O','N','\0'};
> -static const WCHAR OEMFont_Value[] = {'O','E','M','F','O','N','T','.','F','O','N','\0'};
> +static const WCHAR fontsW[] = u"\\fonts";
> +static const WCHAR win9x_font_reg_key[] = u"Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
> +static const WCHAR winnt_font_reg_key[] = u"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
> +static const WCHAR system_fonts_reg_key[] = u"Software\\Fonts";
> +static const WCHAR FixedSys_Value[] = u"FIXEDFON.FON";
> +static const WCHAR System_Value[] = u"FONTS.FON";
> +static const WCHAR OEMFont_Value[] = u"OEMFONT.FON";
>
> static const WCHAR * const SystemFontValues[] = {
> System_Value,
> @@ -507,29 +499,27 @@ static const WCHAR * const SystemFontValues[] = {
> NULL
> };
>
> -static const WCHAR external_fonts_reg_key[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\',
> - 'F','o','n','t','s','\\','E','x','t','e','r','n','a','l',' ','F','o','n','t','s','\0'};
> +static const WCHAR external_fonts_reg_key[] = u"Software\\Wine\\Fonts\\External Fonts";
>
> /* Interesting and well-known (frequently-assumed!) font names */
> -static const WCHAR Lucida_Sans_Unicode[] = {'L','u','c','i','d','a',' ','S','a','n','s',' ','U','n','i','c','o','d','e',0};
> -static const WCHAR Microsoft_Sans_Serif[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f',0 };
> -static const WCHAR Tahoma[] = {'T','a','h','o','m','a',0};
> -static const WCHAR MS_UI_Gothic[] = {'M','S',' ','U','I',' ','G','o','t','h','i','c',0};
> -static const WCHAR SimSun[] = {'S','i','m','S','u','n',0};
> -static const WCHAR Gulim[] = {'G','u','l','i','m',0};
> -static const WCHAR PMingLiU[] = {'P','M','i','n','g','L','i','U',0};
> -static const WCHAR Batang[] = {'B','a','t','a','n','g',0};
> -
> -static const WCHAR arial[] = {'A','r','i','a','l',0};
> -static const WCHAR bitstream_vera_sans[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','a','n','s',0};
> -static const WCHAR bitstream_vera_sans_mono[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','a','n','s',' ','M','o','n','o',0};
> -static const WCHAR bitstream_vera_serif[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','e','r','i','f',0};
> -static const WCHAR courier_new[] = {'C','o','u','r','i','e','r',' ','N','e','w',0};
> -static const WCHAR liberation_mono[] = {'L','i','b','e','r','a','t','i','o','n',' ','M','o','n','o',0};
> -static const WCHAR liberation_sans[] = {'L','i','b','e','r','a','t','i','o','n',' ','S','a','n','s',0};
> -static const WCHAR liberation_serif[] = {'L','i','b','e','r','a','t','i','o','n',' ','S','e','r','i','f',0};
> -static const WCHAR times_new_roman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0};
> -static const WCHAR SymbolW[] = {'S','y','m','b','o','l','\0'};
> +static const WCHAR Lucida_Sans_Unicode[] = u"Lucida Sans Unicode";
> +static const WCHAR Microsoft_Sans_Serif[] = u"Microsoft Sans Serif";
> +static const WCHAR Tahoma[] = u"Tahoma";
> +static const WCHAR MS_UI_Gothic[] = u"MS UI Gothic";
> +static const WCHAR SimSun[] = u"SimSun";
> +static const WCHAR Gulim[] = u"Gulim";
> +static const WCHAR PMingLiU[] = u"PMingLiU";
> +static const WCHAR Batang[] = u"Batang";
> +static const WCHAR arial[] = u"Arial";
> +static const WCHAR bitstream_vera_sans[] = u"Bitstream Vera Sans";
> +static const WCHAR bitstream_vera_sans_mono[] = u"Bitstream Vera Sans Mono";
> +static const WCHAR bitstream_vera_serif[] = u"Bitstream Vera Serif";
> +static const WCHAR courier_new[] = u"Courier New";
> +static const WCHAR liberation_mono[] = u"Liberation Mono";
> +static const WCHAR liberation_sans[] = u"Liberation Sans";
> +static const WCHAR liberation_serif[] = u"Liberation Serif";
> +static const WCHAR times_new_roman[] = u"Times New Roman";
> +static const WCHAR SymbolW[] = u"Symbol";
>
> static const WCHAR *default_serif_list[] =
> {
> @@ -571,23 +561,22 @@ typedef struct tagFontSubst {
> } FontSubst;
>
> /* Registry font cache key and value names */
> -static const WCHAR wine_fonts_key[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\',
> - 'F','o','n','t','s',0};
> -static const WCHAR wine_fonts_cache_key[] = {'C','a','c','h','e',0};
> -static const WCHAR english_name_value[] = {'E','n','g','l','i','s','h',' ','N','a','m','e',0};
> -static const WCHAR face_index_value[] = {'I','n','d','e','x',0};
> -static const WCHAR face_ntmflags_value[] = {'N','t','m','f','l','a','g','s',0};
> -static const WCHAR face_version_value[] = {'V','e','r','s','i','o','n',0};
> -static const WCHAR face_height_value[] = {'H','e','i','g','h','t',0};
> -static const WCHAR face_width_value[] = {'W','i','d','t','h',0};
> -static const WCHAR face_size_value[] = {'S','i','z','e',0};
> -static const WCHAR face_x_ppem_value[] = {'X','p','p','e','m',0};
> -static const WCHAR face_y_ppem_value[] = {'Y','p','p','e','m',0};
> -static const WCHAR face_flags_value[] = {'F','l','a','g','s',0};
> -static const WCHAR face_internal_leading_value[] = {'I','n','t','e','r','n','a','l',' ','L','e','a','d','i','n','g',0};
> -static const WCHAR face_font_sig_value[] = {'F','o','n','t',' ','S','i','g','n','a','t','u','r','e',0};
> -static const WCHAR face_file_name_value[] = {'F','i','l','e',' ','N','a','m','e','\0'};
> -static const WCHAR face_full_name_value[] = {'F','u','l','l',' ','N','a','m','e','\0'};
> +static const WCHAR wine_fonts_key[] = u"Software\\Wine\\Fonts";
> +static const WCHAR wine_fonts_cache_key[] = u"Cache";
> +static const WCHAR english_name_value[] = u"English Name";
> +static const WCHAR face_index_value[] = u"Index";
> +static const WCHAR face_ntmflags_value[] = u"Ntmflags";
> +static const WCHAR face_version_value[] = u"Version";
> +static const WCHAR face_height_value[] = u"Height";
> +static const WCHAR face_width_value[] = u"Width";
> +static const WCHAR face_size_value[] = u"Size";
> +static const WCHAR face_x_ppem_value[] = u"Xppem";
> +static const WCHAR face_y_ppem_value[] = u"Yppem";
> +static const WCHAR face_flags_value[] = u"Flags";
> +static const WCHAR face_internal_leading_value[] = u"Internal Leading";
> +static const WCHAR face_font_sig_value[] = u"Font Signature";
> +static const WCHAR face_file_name_value[] = u"File Name";
> +static const WCHAR face_full_name_value[] = u"Full Name";
>
>
> struct font_mapping
> @@ -615,9 +604,9 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
> };
> static CRITICAL_SECTION freetype_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
>
> -static const WCHAR font_mutex_nameW[] = {'_','_','W','I','N','E','_','F','O','N','T','_','M','U','T','E','X','_','_','\0'};
> +static const WCHAR font_mutex_nameW[] = u"__WINE_FONT_MUTEX__";
>
> -static const WCHAR szDefaultFallbackLink[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f',0};
> +static const WCHAR szDefaultFallbackLink[] = u"Microsoft Sans Serif";
> static BOOL use_default_fallback = FALSE;
>
> static BOOL get_glyph_index_linked(GdiFont *font, UINT c, GdiFont **linked_font, FT_UInt *glyph, BOOL *vert);
> @@ -626,10 +615,7 @@ static BOOL get_bitmap_text_metrics(GdiFont *font);
> static BOOL get_text_metrics(GdiFont *font, LPTEXTMETRICW ptm);
> static void remove_face_from_cache( Face *face );
>
> -static const WCHAR system_link[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
> - 'W','i','n','d','o','w','s',' ','N','T','\\',
> - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','F','o','n','t','L','i','n','k','\\',
> - 'S','y','s','t','e','m','L','i','n','k',0};
> +static const WCHAR system_link[] = u"Software\\Microsoft\\Windows NT\\CurrentVersion\\FontLink\\SystemLink";
>
> /****************************************
> * Notes on .fon files
> @@ -1835,7 +1821,7 @@ static void add_face_to_cache(Face *face)
> face_key_name = face->StyleName;
> else
> {
> - static const WCHAR fmtW[] = {'%','s','\\','%','d',0};
> + static const WCHAR fmtW[] = u"%s\\%d";
> face_key_name = HeapAlloc(GetProcessHeap(), 0, (strlenW(face->StyleName) + 10) * sizeof(WCHAR));
> sprintfW(face_key_name, fmtW, face->StyleName, face->size.y_ppem);
> }
> @@ -1882,7 +1868,7 @@ static void remove_face_from_cache( Face *face )
> }
> else
> {
> - static const WCHAR fmtW[] = {'%','s','\\','%','d',0};
> + static const WCHAR fmtW[] = u"%s\\%d";
> WCHAR *face_key_name = HeapAlloc(GetProcessHeap(), 0, (strlenW(face->StyleName) + 10) * sizeof(WCHAR));
> sprintfW(face_key_name, fmtW, face->StyleName, face->size.y_ppem);
> RegDeleteKeyW( hkey_family, face_key_name );
> @@ -2576,9 +2562,9 @@ static void init_system_links(void)
> WCHAR *entry, *next;
> SYSTEM_LINKS *font_link, *system_font_link;
> CHILD_FONT *child_font;
> - static const WCHAR tahoma_ttf[] = {'t','a','h','o','m','a','.','t','t','f',0};
> - static const WCHAR System[] = {'S','y','s','t','e','m',0};
> - static const WCHAR MS_Shell_Dlg[] = {'M','S',' ','S','h','e','l','l',' ','D','l','g',0};
> + static const WCHAR tahoma_ttf[] = u"tahoma.ttf";
> + static const WCHAR System[] = u"System";
> + static const WCHAR MS_Shell_Dlg[] = u"MS Shell Dlg";
> Face *face;
> FontSubst *psub;
> UINT i, j;
> @@ -3067,7 +3053,7 @@ static BOOL load_font_from_data_dir(LPCWSTR file)
>
> static char *get_winfonts_dir_path(LPCWSTR file)
> {
> - static const WCHAR slashW[] = {'\\','\0'};
> + static const WCHAR slashW[] = u"\\";
> WCHAR windowsdir[MAX_PATH];
>
> GetWindowsDirectoryW(windowsdir, ARRAY_SIZE(windowsdir));
> @@ -3083,7 +3069,7 @@ static void load_system_fonts(void)
> WCHAR data[MAX_PATH], windowsdir[MAX_PATH], pathW[MAX_PATH];
> const WCHAR * const *value;
> DWORD dlen, type;
> - static const WCHAR fmtW[] = {'%','s','\\','%','s','\0'};
> + static const WCHAR fmtW[] = u"%s\\%s";
> char *unixname;
>
> if(RegOpenKeyW(HKEY_CURRENT_CONFIG, system_fonts_reg_key, &hkey) == ERROR_SUCCESS) {
> @@ -3123,7 +3109,7 @@ static void update_reg_entries(void)
> Family *family;
> Face *face;
> WCHAR *file, *path;
> - static const WCHAR TrueType[] = {' ','(','T','r','u','e','T','y','p','e',')','\0'};
> + static const WCHAR TrueType[] = u" (TrueType)";
>
> if(RegCreateKeyExW(HKEY_LOCAL_MACHINE, winnt_font_reg_key,
> 0, NULL, 0, KEY_ALL_ACCESS, NULL, &winnt_key, NULL) != ERROR_SUCCESS) {
> @@ -3931,35 +3917,15 @@ static void set_multi_value_key(HKEY hkey, const WCHAR *name, const WCHAR *value
> static void update_font_system_link_info(UINT current_ansi_codepage)
> {
> static const WCHAR system_link_simplified_chinese[] =
> - {'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0',
> - 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','u','\0',
> - 'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0',
> - 'B','A','T','A','N','G','.','T','T','C',',','B','a','t','a','n','g','\0',
> - '\0'};
> + u"SIMSUN.TTC,SimSun\0MINGLIU.TTC,PMingLiu\0MSGOTHIC.TTC,MS UI Gothic\0BATANG.TTC,Batang\0";
> static const WCHAR system_link_traditional_chinese[] =
> - {'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','u','\0',
> - 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0',
> - 'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0',
> - 'B','A','T','A','N','G','.','T','T','C',',','B','a','t','a','n','g','\0',
> - '\0'};
> + u"MINGLIU.TTC,PMingLiu\0SIMSUN.TTC,SimSun\0MSGOTHIC.TTC,MS UI Gothic\0BATANG.TTC,Batang\0";
> static const WCHAR system_link_japanese[] =
> - {'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0',
> - 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','U','\0',
> - 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0',
> - 'G','U','L','I','M','.','T','T','C',',','G','u','l','i','m','\0',
> - '\0'};
> + u"MSGOTHIC.TTC,MS UI Gothic\0MINGLIU.TTC,PMingLiU\0SIMSUN.TTC,SimSun\0GULIM.TTC,Gulim\0";
> static const WCHAR system_link_korean[] =
> - {'G','U','L','I','M','.','T','T','C',',','G','u','l','i','m','\0',
> - 'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0',
> - 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','U','\0',
> - 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0',
> - '\0'};
> + u"GULIM.TTC,Gulim\0MSGOTHIC.TTC,MS UI Gothic\0MINGLIU.TTC,PMingLiU\0SIMSUN.TTC,SimSun\0";
> static const WCHAR system_link_non_cjk[] =
> - {'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0',
> - 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','U','\0',
> - 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0',
> - 'G','U','L','I','M','.','T','T','C',',','G','u','l','i','m','\0',
> - '\0'};
> + u"MSGOTHIC.TTC,MS UI Gothic\0MINGLIU.TTC,PMingLiU\0SIMSUN.TTC,SimSun\0GULIM.TTC,Gulim\0";
> HKEY hkey;
>
> if (RegCreateKeyW(HKEY_LOCAL_MACHINE, system_link, &hkey) == ERROR_SUCCESS)
> @@ -3998,7 +3964,7 @@ static void update_font_system_link_info(UINT current_ansi_codepage)
>
> static void update_font_info(void)
> {
> - static const WCHAR logpixels[] = { 'L','o','g','P','i','x','e','l','s',0 };
> + static const WCHAR logpixels[] = u"LogPixels";
> char buf[40], cpbuf[40];
> DWORD len, type;
> HKEY hkey = 0;
> @@ -4199,8 +4165,8 @@ sym_not_found:
>
> static void init_font_list(void)
> {
> - static const WCHAR dot_fonW[] = {'.','f','o','n','\0'};
> - static const WCHAR pathW[] = {'P','a','t','h',0};
> + static const WCHAR dot_fonW[] = u".fon";
> + static const WCHAR pathW[] = u"Path";
> HKEY hkey;
> DWORD valuelen, datalen, i = 0, type, dlen, vlen;
> WCHAR windowsdir[MAX_PATH];
> @@ -4260,7 +4226,7 @@ static void init_font_list(void)
> else if(dlen / 2 >= 6 && !strcmpiW(data + dlen / 2 - 5, dot_fonW))
> {
> WCHAR pathW[MAX_PATH];
> - static const WCHAR fmtW[] = {'%','s','\\','%','s','\0'};
> + static const WCHAR fmtW[] = u"%s\\%s";
> BOOL added = FALSE;
>
> sprintfW(pathW, fmtW, windowsdir, data);
> @@ -4391,9 +4357,8 @@ BOOL WineEngInit(void)
>
> if (!RegOpenKeyExW(HKEY_CURRENT_USER, wine_fonts_key, 0, KEY_READ, &hkey))
> {
> - static const WCHAR antialias_fake_bold_or_italic[] = { 'A','n','t','i','a','l','i','a','s','F','a','k','e',
> - 'B','o','l','d','O','r','I','t','a','l','i','c',0 };
> - static const WCHAR true_options[] = { 'y','Y','t','T','1',0 };
> + static const WCHAR antialias_fake_bold_or_italic[] = u"AntialiasFakeBoldOrItalic";
> + static const WCHAR true_options[] = u"yYtT1";
> DWORD type, size;
> WCHAR buffer[20];
>
> @@ -7934,7 +7899,7 @@ static BOOL get_outline_text_metrics(GdiFont *font)
> full_nameW = get_face_name( ft_face, TT_NAME_ID_UNIQUE_ID, GetSystemDefaultLangID() );
> if (!full_nameW)
> {
> - static const WCHAR fake_nameW[] = {'f','a','k','e',' ','n','a','m','e', 0};
> + static const WCHAR fake_nameW[] = u"fake name";
> FIXME("failed to read full_nameW for font %s!\n", wine_dbgstr_w(font->name));
> full_nameW = strdupW(fake_nameW);
> }
> diff --git a/dlls/gdi32/gdiobj.c b/dlls/gdi32/gdiobj.c
> index 083a504569..0daa426111 100644
> --- a/dlls/gdi32/gdiobj.c
> +++ b/dlls/gdi32/gdiobj.c
> @@ -128,17 +128,15 @@ static CRITICAL_SECTION gdi_section = { &critsect_debug, -1, 0, 0, 0, 0 };
>
> static const LOGFONTW OEMFixedFont =
> { 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, OEM_CHARSET,
> - 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, {'\0'} };
> + 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, u""};
>
> static const LOGFONTW AnsiFixedFont =
> { 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
> - 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'} };
> + 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, u"Courier"};
>
> static const LOGFONTW AnsiVarFont =
> { 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
> - 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'} };
> + 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, u"MS Sans Serif"};
>
> /******************************************************************************
> *
> @@ -173,308 +171,308 @@ static const struct DefaultFontInfo default_fonts[] =
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { EASTEUROPE_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, EASTEUROPE_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, EASTEUROPE_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, EASTEUROPE_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, EASTEUROPE_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { RUSSIAN_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, RUSSIAN_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, RUSSIAN_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, RUSSIAN_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, RUSSIAN_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { GREEK_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, GREEK_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, GREEK_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, GREEK_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, GREEK_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { TURKISH_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, TURKISH_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, TURKISH_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, TURKISH_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, TURKISH_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { HEBREW_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, HEBREW_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, HEBREW_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HEBREW_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HEBREW_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { ARABIC_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ARABIC_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ARABIC_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ARABIC_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ARABIC_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { BALTIC_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, BALTIC_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, BALTIC_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, BALTIC_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, BALTIC_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { THAI_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, THAI_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, THAI_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, THAI_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, THAI_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { SHIFTJIS_CHARSET,
> { /* System */
> 18, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 18, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { GB2312_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, GB2312_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, GB2312_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, GB2312_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, GB2312_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { HANGEUL_CHARSET,
> { /* System */
> 16, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HANGEUL_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HANGEUL_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HANGEUL_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HANGEUL_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { CHINESEBIG5_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, CHINESEBIG5_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, CHINESEBIG5_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, CHINESEBIG5_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, CHINESEBIG5_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> { JOHAB_CHARSET,
> { /* System */
> 16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, JOHAB_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* Device Default */
> 16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, JOHAB_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'S','y','s','t','e','m','\0'}
> + u"System"
> },
> { /* System Fixed */
> 16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, JOHAB_CHARSET,
> 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
> - {'C','o','u','r','i','e','r','\0'}
> + u"Courier"
> },
> { /* DefaultGuiFont */
> -12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, JOHAB_CHARSET,
> 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
> - {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
> + u"MS Shell Dlg"
> },
> },
> };
> @@ -598,9 +596,9 @@ BOOL GDI_dec_ref_count( HGDIOBJ handle )
> return entry != NULL;
> }
>
> -static const WCHAR dpi_key_name[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\0'};
> -static const WCHAR def_dpi_key_name[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
> -static const WCHAR dpi_value_name[] = {'L','o','g','P','i','x','e','l','s','\0'};
> +static const WCHAR dpi_key_name[] = u"Control Panel\\Desktop";
> +static const WCHAR def_dpi_key_name[] = u"Software\\Fonts";
> +static const WCHAR dpi_value_name[] = u"LogPixels";
>
> /******************************************************************************
> * get_reg_dword
> @@ -653,7 +651,7 @@ DWORD get_system_dpi(void)
>
> if (!pGetDpiForSystem)
> {
> - static const WCHAR user32W[] = {'u','s','e','r','3','2','.','d','l','l',0};
> + static const WCHAR user32W[] = u"user32.dll";
> HMODULE user = GetModuleHandleW( user32W );
> if (user) pGetDpiForSystem = (void *)GetProcAddress( user, "GetDpiForSystem" );
> }
> diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c
> index 578737994a..dd23538b82 100644
> --- a/dlls/gdi32/opengl.c
> +++ b/dlls/gdi32/opengl.c
> @@ -36,7 +36,7 @@
> #include "gdi_private.h"
>
>
> -static const WCHAR opengl32W[] = {'o','p','e','n','g','l','3','2','.','d','l','l',0};
> +static const WCHAR opengl32W[] = u"opengl32.dll";
> static HMODULE opengl32;
> static INT (WINAPI *wglChoosePixelFormat)(HDC,const PIXELFORMATDESCRIPTOR *);
> static INT (WINAPI *wglDescribePixelFormat)(HDC,INT,UINT,PIXELFORMATDESCRIPTOR*);
> diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c
> index cad6428dc9..b2c3882ad9 100644
> --- a/dlls/gdi32/region.c
> +++ b/dlls/gdi32/region.c
> @@ -1437,7 +1437,7 @@ INT mirror_region( HRGN dst, HRGN src, INT width )
> */
> BOOL WINAPI MirrorRgn( HWND hwnd, HRGN hrgn )
> {
> - static const WCHAR user32W[] = {'u','s','e','r','3','2','.','d','l','l',0};
> + static const WCHAR user32W[] = u"user32.dll";
> static BOOL (WINAPI *pGetWindowRect)( HWND hwnd, LPRECT rect );
> RECT rect;
>
April 1, 2019
Re: [PATCH] gdi32: Reformat some strings to improve readability
by Huw Davies
This is amazing---let's get it in today.
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
April 1, 2019
[PATCH] gdi32: Reformat some strings to improve readability
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
No-op as gcc generates the exact same object files.
Only gdiobj.c, font.c and freetype.c need "CFLAGS=-O2 -g0 -DNDEBUG" as
they use asserts and the line count changes.
dlls/gdi32/dc.c | 2 +-
dlls/gdi32/driver.c | 12 +--
dlls/gdi32/enhmetafile.c | 2 +-
dlls/gdi32/enhmfdrv/init.c | 2 +-
dlls/gdi32/font.c | 34 +++-----
dlls/gdi32/freetype.c | 165 +++++++++++++++----------------------
dlls/gdi32/gdiobj.c | 128 ++++++++++++++--------------
dlls/gdi32/opengl.c | 2 +-
dlls/gdi32/region.c | 2 +-
9 files changed, 151 insertions(+), 198 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index 8ee8a52d94..159e8436f0 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -36,7 +36,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(dc);
-static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
+static const WCHAR displayW[] = u"display";
static BOOL DC_DeleteObject( HGDIOBJ handle );
diff --git a/dlls/gdi32/driver.c b/dlls/gdi32/driver.c
index 054d7cf418..7dd025813c 100644
--- a/dlls/gdi32/driver.c
+++ b/dlls/gdi32/driver.c
@@ -125,8 +125,8 @@ const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name )
{
HMODULE module;
struct graphics_driver *driver, *new_driver;
- static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
- static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
+ static const WCHAR displayW[] = u"display";
+ static const WCHAR display1W[] = u"\\\\.\\DISPLAY1";
/* display driver is a special case */
if (!strcmpiW( name, displayW ) || !strcmpiW( name, display1W )) return get_display_driver();
@@ -858,10 +858,10 @@ const struct gdi_dc_funcs null_driver =
*/
BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size )
{
- static const WCHAR displayW[] = { 'd','i','s','p','l','a','y',0 };
- static const WCHAR devicesW[] = { 'd','e','v','i','c','e','s',0 };
- static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
- static const WCHAR empty_strW[] = { 0 };
+ static const WCHAR displayW[] = u"display";
+ static const WCHAR devicesW[] = u"devices";
+ static const WCHAR display1W[] = u"\\\\.\\DISPLAY1";
+ static const WCHAR empty_strW[] = u"";
WCHAR *p;
/* display is a special case */
diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c
index a3360c269a..ff669470d1 100644
--- a/dlls/gdi32/enhmetafile.c
+++ b/dlls/gdi32/enhmetafile.c
@@ -2810,7 +2810,7 @@ typedef struct wmf_in_emf_comment
HENHMETAFILE WINAPI SetWinMetaFileBits(UINT cbBuffer, const BYTE *lpbBuffer, HDC hdcRef,
const METAFILEPICT *lpmfp)
{
- static const WCHAR szDisplayW[] = { 'D','I','S','P','L','A','Y','\0' };
+ static const WCHAR szDisplayW[] = u"DISPLAY";
HMETAFILE hmf = NULL;
HENHMETAFILE ret = NULL;
HDC hdc = NULL, hdcdisp = NULL;
diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c
index 51133705a5..2e47455bdc 100644
--- a/dlls/gdi32/enhmfdrv/init.c
+++ b/dlls/gdi32/enhmfdrv/init.c
@@ -329,7 +329,7 @@ HDC WINAPI CreateEnhMetaFileW(
LPCWSTR description /* [in] optional description */
)
{
- static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0};
+ static const WCHAR displayW[] = u"DISPLAY";
HDC ret, ref_dc;
DC *dc;
EMFDRV_PDEVICE *physDev;
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index b3d67ff624..14f432f34c 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -278,8 +278,7 @@ static DWORD get_key_value( HKEY key, const WCHAR *name, DWORD *value )
static UINT get_subpixel_orientation( HKEY key )
{
- static const WCHAR smoothing_orientation[] = {'F','o','n','t','S','m','o','o','t','h','i','n','g',
- 'O','r','i','e','n','t','a','t','i','o','n',0};
+ static const WCHAR smoothing_orientation[] = u"FontSmoothingOrientation";
DWORD orient;
/* FIXME: handle vertical orientations even though Windows doesn't */
@@ -297,8 +296,8 @@ static UINT get_subpixel_orientation( HKEY key )
static UINT get_default_smoothing( HKEY key )
{
- static const WCHAR smoothing[] = {'F','o','n','t','S','m','o','o','t','h','i','n','g',0};
- static const WCHAR smoothing_type[] = {'F','o','n','t','S','m','o','o','t','h','i','n','g','T','y','p','e',0};
+ static const WCHAR smoothing[] = u"FontSmoothing";
+ static const WCHAR smoothing_type[] = u"FontSmoothingType";
DWORD enabled, type;
if (get_key_value( key, smoothing, &enabled )) return 0;
@@ -635,14 +634,11 @@ static DWORD get_associated_charset_info(void)
if (associated_charset == -1)
{
- static const WCHAR assoc_charset_reg_keyW[] = {'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','\\','F','o','n','t','A','s','s','o','c','\\',
- 'A','s','s','o','c','i','a','t','e','d',' ','C','h','a','r','s','e','t','\0'};
- static const WCHAR ansiW[] = {'A','N','S','I','(','0','0',')','\0'};
- static const WCHAR oemW[] = {'O','E','M','(','F','F',')','\0'};
- static const WCHAR symbolW[] = {'S','Y','M','B','O','L','(','0','2',')','\0'};
- static const WCHAR yesW[] = {'Y','E','S','\0'};
+ static const WCHAR assoc_charset_reg_keyW[] = u"System\\CurrentControlSet\\Control\\FontAssoc\\Associated Charset";
+ static const WCHAR ansiW[] = u"ANSI(00)";
+ static const WCHAR oemW[] = u"OEM(FF)";
+ static const WCHAR symbolW[] = u"SYMBOL(02)";
+ static const WCHAR yesW[] = u"YES";
HKEY hkey;
WCHAR dataW[32];
DWORD type, data_len;
@@ -731,10 +727,8 @@ static void update_font_code_page( DC *dc, HANDLE font )
static struct font_gamma_ramp *get_font_gamma_ramp( void )
{
- static const WCHAR desktopW[] = { 'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
- 'D','e','s','k','t','o','p',0 };
- static const WCHAR smoothing_gamma[] = { 'F','o','n','t','S','m','o','o','t','h','i','n','g',
- 'G','a','m','m','a',0 };
+ static const WCHAR desktopW[] = u"Control Panel\\Desktop";
+ static const WCHAR smoothing_gamma[] = u"FontSmoothingGamma";
const DWORD gamma_default = 1400;
struct font_gamma_ramp *ramp;
DWORD i, gamma;
@@ -863,8 +857,7 @@ static BOOL FONT_DeleteObject( HGDIOBJ handle )
*/
HFONT nulldrv_SelectFont( PHYSDEV dev, HFONT font, UINT *aa_flags )
{
- static const WCHAR desktopW[] = { 'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
- 'D','e','s','k','t','o','p',0 };
+ static const WCHAR desktopW[] = u"Control Panel\\Desktop";
static int orientation = -1, smoothing = -1;
LOGFONTW lf;
HKEY key;
@@ -3810,10 +3803,7 @@ UINT WINAPI GetTextCharset(HDC hdc)
LONG WINAPI GdiGetCharDimensions(HDC hdc, LPTEXTMETRICW lptm, LONG *height)
{
SIZE sz;
- static const WCHAR alphabet[] = {
- 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
- 'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
- 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
+ static const WCHAR alphabet[] = u"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
if(lptm && !GetTextMetricsW(hdc, lptm)) return 0;
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 333856e325..0ada635fea 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -484,21 +484,13 @@ static inline struct freetype_physdev *get_freetype_dev( PHYSDEV dev )
static const struct gdi_dc_funcs freetype_funcs;
-static const WCHAR fontsW[] = {'\\','f','o','n','t','s','\0'};
-static const WCHAR win9x_font_reg_key[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'F','o','n','t','s','\0'};
-
-static const WCHAR winnt_font_reg_key[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s',' ','N','T','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'F','o','n','t','s','\0'};
-
-static const WCHAR system_fonts_reg_key[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
-static const WCHAR FixedSys_Value[] = {'F','I','X','E','D','F','O','N','.','F','O','N','\0'};
-static const WCHAR System_Value[] = {'F','O','N','T','S','.','F','O','N','\0'};
-static const WCHAR OEMFont_Value[] = {'O','E','M','F','O','N','T','.','F','O','N','\0'};
+static const WCHAR fontsW[] = u"\\fonts";
+static const WCHAR win9x_font_reg_key[] = u"Software\\Microsoft\\Windows\\CurrentVersion\\Fonts";
+static const WCHAR winnt_font_reg_key[] = u"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
+static const WCHAR system_fonts_reg_key[] = u"Software\\Fonts";
+static const WCHAR FixedSys_Value[] = u"FIXEDFON.FON";
+static const WCHAR System_Value[] = u"FONTS.FON";
+static const WCHAR OEMFont_Value[] = u"OEMFONT.FON";
static const WCHAR * const SystemFontValues[] = {
System_Value,
@@ -507,29 +499,27 @@ static const WCHAR * const SystemFontValues[] = {
NULL
};
-static const WCHAR external_fonts_reg_key[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\',
- 'F','o','n','t','s','\\','E','x','t','e','r','n','a','l',' ','F','o','n','t','s','\0'};
+static const WCHAR external_fonts_reg_key[] = u"Software\\Wine\\Fonts\\External Fonts";
/* Interesting and well-known (frequently-assumed!) font names */
-static const WCHAR Lucida_Sans_Unicode[] = {'L','u','c','i','d','a',' ','S','a','n','s',' ','U','n','i','c','o','d','e',0};
-static const WCHAR Microsoft_Sans_Serif[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f',0 };
-static const WCHAR Tahoma[] = {'T','a','h','o','m','a',0};
-static const WCHAR MS_UI_Gothic[] = {'M','S',' ','U','I',' ','G','o','t','h','i','c',0};
-static const WCHAR SimSun[] = {'S','i','m','S','u','n',0};
-static const WCHAR Gulim[] = {'G','u','l','i','m',0};
-static const WCHAR PMingLiU[] = {'P','M','i','n','g','L','i','U',0};
-static const WCHAR Batang[] = {'B','a','t','a','n','g',0};
-
-static const WCHAR arial[] = {'A','r','i','a','l',0};
-static const WCHAR bitstream_vera_sans[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','a','n','s',0};
-static const WCHAR bitstream_vera_sans_mono[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','a','n','s',' ','M','o','n','o',0};
-static const WCHAR bitstream_vera_serif[] = {'B','i','t','s','t','r','e','a','m',' ','V','e','r','a',' ','S','e','r','i','f',0};
-static const WCHAR courier_new[] = {'C','o','u','r','i','e','r',' ','N','e','w',0};
-static const WCHAR liberation_mono[] = {'L','i','b','e','r','a','t','i','o','n',' ','M','o','n','o',0};
-static const WCHAR liberation_sans[] = {'L','i','b','e','r','a','t','i','o','n',' ','S','a','n','s',0};
-static const WCHAR liberation_serif[] = {'L','i','b','e','r','a','t','i','o','n',' ','S','e','r','i','f',0};
-static const WCHAR times_new_roman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0};
-static const WCHAR SymbolW[] = {'S','y','m','b','o','l','\0'};
+static const WCHAR Lucida_Sans_Unicode[] = u"Lucida Sans Unicode";
+static const WCHAR Microsoft_Sans_Serif[] = u"Microsoft Sans Serif";
+static const WCHAR Tahoma[] = u"Tahoma";
+static const WCHAR MS_UI_Gothic[] = u"MS UI Gothic";
+static const WCHAR SimSun[] = u"SimSun";
+static const WCHAR Gulim[] = u"Gulim";
+static const WCHAR PMingLiU[] = u"PMingLiU";
+static const WCHAR Batang[] = u"Batang";
+static const WCHAR arial[] = u"Arial";
+static const WCHAR bitstream_vera_sans[] = u"Bitstream Vera Sans";
+static const WCHAR bitstream_vera_sans_mono[] = u"Bitstream Vera Sans Mono";
+static const WCHAR bitstream_vera_serif[] = u"Bitstream Vera Serif";
+static const WCHAR courier_new[] = u"Courier New";
+static const WCHAR liberation_mono[] = u"Liberation Mono";
+static const WCHAR liberation_sans[] = u"Liberation Sans";
+static const WCHAR liberation_serif[] = u"Liberation Serif";
+static const WCHAR times_new_roman[] = u"Times New Roman";
+static const WCHAR SymbolW[] = u"Symbol";
static const WCHAR *default_serif_list[] =
{
@@ -571,23 +561,22 @@ typedef struct tagFontSubst {
} FontSubst;
/* Registry font cache key and value names */
-static const WCHAR wine_fonts_key[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\',
- 'F','o','n','t','s',0};
-static const WCHAR wine_fonts_cache_key[] = {'C','a','c','h','e',0};
-static const WCHAR english_name_value[] = {'E','n','g','l','i','s','h',' ','N','a','m','e',0};
-static const WCHAR face_index_value[] = {'I','n','d','e','x',0};
-static const WCHAR face_ntmflags_value[] = {'N','t','m','f','l','a','g','s',0};
-static const WCHAR face_version_value[] = {'V','e','r','s','i','o','n',0};
-static const WCHAR face_height_value[] = {'H','e','i','g','h','t',0};
-static const WCHAR face_width_value[] = {'W','i','d','t','h',0};
-static const WCHAR face_size_value[] = {'S','i','z','e',0};
-static const WCHAR face_x_ppem_value[] = {'X','p','p','e','m',0};
-static const WCHAR face_y_ppem_value[] = {'Y','p','p','e','m',0};
-static const WCHAR face_flags_value[] = {'F','l','a','g','s',0};
-static const WCHAR face_internal_leading_value[] = {'I','n','t','e','r','n','a','l',' ','L','e','a','d','i','n','g',0};
-static const WCHAR face_font_sig_value[] = {'F','o','n','t',' ','S','i','g','n','a','t','u','r','e',0};
-static const WCHAR face_file_name_value[] = {'F','i','l','e',' ','N','a','m','e','\0'};
-static const WCHAR face_full_name_value[] = {'F','u','l','l',' ','N','a','m','e','\0'};
+static const WCHAR wine_fonts_key[] = u"Software\\Wine\\Fonts";
+static const WCHAR wine_fonts_cache_key[] = u"Cache";
+static const WCHAR english_name_value[] = u"English Name";
+static const WCHAR face_index_value[] = u"Index";
+static const WCHAR face_ntmflags_value[] = u"Ntmflags";
+static const WCHAR face_version_value[] = u"Version";
+static const WCHAR face_height_value[] = u"Height";
+static const WCHAR face_width_value[] = u"Width";
+static const WCHAR face_size_value[] = u"Size";
+static const WCHAR face_x_ppem_value[] = u"Xppem";
+static const WCHAR face_y_ppem_value[] = u"Yppem";
+static const WCHAR face_flags_value[] = u"Flags";
+static const WCHAR face_internal_leading_value[] = u"Internal Leading";
+static const WCHAR face_font_sig_value[] = u"Font Signature";
+static const WCHAR face_file_name_value[] = u"File Name";
+static const WCHAR face_full_name_value[] = u"Full Name";
struct font_mapping
@@ -615,9 +604,9 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
};
static CRITICAL_SECTION freetype_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
-static const WCHAR font_mutex_nameW[] = {'_','_','W','I','N','E','_','F','O','N','T','_','M','U','T','E','X','_','_','\0'};
+static const WCHAR font_mutex_nameW[] = u"__WINE_FONT_MUTEX__";
-static const WCHAR szDefaultFallbackLink[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f',0};
+static const WCHAR szDefaultFallbackLink[] = u"Microsoft Sans Serif";
static BOOL use_default_fallback = FALSE;
static BOOL get_glyph_index_linked(GdiFont *font, UINT c, GdiFont **linked_font, FT_UInt *glyph, BOOL *vert);
@@ -626,10 +615,7 @@ static BOOL get_bitmap_text_metrics(GdiFont *font);
static BOOL get_text_metrics(GdiFont *font, LPTEXTMETRICW ptm);
static void remove_face_from_cache( Face *face );
-static const WCHAR system_link[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s',' ','N','T','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','F','o','n','t','L','i','n','k','\\',
- 'S','y','s','t','e','m','L','i','n','k',0};
+static const WCHAR system_link[] = u"Software\\Microsoft\\Windows NT\\CurrentVersion\\FontLink\\SystemLink";
/****************************************
* Notes on .fon files
@@ -1835,7 +1821,7 @@ static void add_face_to_cache(Face *face)
face_key_name = face->StyleName;
else
{
- static const WCHAR fmtW[] = {'%','s','\\','%','d',0};
+ static const WCHAR fmtW[] = u"%s\\%d";
face_key_name = HeapAlloc(GetProcessHeap(), 0, (strlenW(face->StyleName) + 10) * sizeof(WCHAR));
sprintfW(face_key_name, fmtW, face->StyleName, face->size.y_ppem);
}
@@ -1882,7 +1868,7 @@ static void remove_face_from_cache( Face *face )
}
else
{
- static const WCHAR fmtW[] = {'%','s','\\','%','d',0};
+ static const WCHAR fmtW[] = u"%s\\%d";
WCHAR *face_key_name = HeapAlloc(GetProcessHeap(), 0, (strlenW(face->StyleName) + 10) * sizeof(WCHAR));
sprintfW(face_key_name, fmtW, face->StyleName, face->size.y_ppem);
RegDeleteKeyW( hkey_family, face_key_name );
@@ -2576,9 +2562,9 @@ static void init_system_links(void)
WCHAR *entry, *next;
SYSTEM_LINKS *font_link, *system_font_link;
CHILD_FONT *child_font;
- static const WCHAR tahoma_ttf[] = {'t','a','h','o','m','a','.','t','t','f',0};
- static const WCHAR System[] = {'S','y','s','t','e','m',0};
- static const WCHAR MS_Shell_Dlg[] = {'M','S',' ','S','h','e','l','l',' ','D','l','g',0};
+ static const WCHAR tahoma_ttf[] = u"tahoma.ttf";
+ static const WCHAR System[] = u"System";
+ static const WCHAR MS_Shell_Dlg[] = u"MS Shell Dlg";
Face *face;
FontSubst *psub;
UINT i, j;
@@ -3067,7 +3053,7 @@ static BOOL load_font_from_data_dir(LPCWSTR file)
static char *get_winfonts_dir_path(LPCWSTR file)
{
- static const WCHAR slashW[] = {'\\','\0'};
+ static const WCHAR slashW[] = u"\\";
WCHAR windowsdir[MAX_PATH];
GetWindowsDirectoryW(windowsdir, ARRAY_SIZE(windowsdir));
@@ -3083,7 +3069,7 @@ static void load_system_fonts(void)
WCHAR data[MAX_PATH], windowsdir[MAX_PATH], pathW[MAX_PATH];
const WCHAR * const *value;
DWORD dlen, type;
- static const WCHAR fmtW[] = {'%','s','\\','%','s','\0'};
+ static const WCHAR fmtW[] = u"%s\\%s";
char *unixname;
if(RegOpenKeyW(HKEY_CURRENT_CONFIG, system_fonts_reg_key, &hkey) == ERROR_SUCCESS) {
@@ -3123,7 +3109,7 @@ static void update_reg_entries(void)
Family *family;
Face *face;
WCHAR *file, *path;
- static const WCHAR TrueType[] = {' ','(','T','r','u','e','T','y','p','e',')','\0'};
+ static const WCHAR TrueType[] = u" (TrueType)";
if(RegCreateKeyExW(HKEY_LOCAL_MACHINE, winnt_font_reg_key,
0, NULL, 0, KEY_ALL_ACCESS, NULL, &winnt_key, NULL) != ERROR_SUCCESS) {
@@ -3931,35 +3917,15 @@ static void set_multi_value_key(HKEY hkey, const WCHAR *name, const WCHAR *value
static void update_font_system_link_info(UINT current_ansi_codepage)
{
static const WCHAR system_link_simplified_chinese[] =
- {'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0',
- 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','u','\0',
- 'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0',
- 'B','A','T','A','N','G','.','T','T','C',',','B','a','t','a','n','g','\0',
- '\0'};
+ u"SIMSUN.TTC,SimSun\0MINGLIU.TTC,PMingLiu\0MSGOTHIC.TTC,MS UI Gothic\0BATANG.TTC,Batang\0";
static const WCHAR system_link_traditional_chinese[] =
- {'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','u','\0',
- 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0',
- 'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0',
- 'B','A','T','A','N','G','.','T','T','C',',','B','a','t','a','n','g','\0',
- '\0'};
+ u"MINGLIU.TTC,PMingLiu\0SIMSUN.TTC,SimSun\0MSGOTHIC.TTC,MS UI Gothic\0BATANG.TTC,Batang\0";
static const WCHAR system_link_japanese[] =
- {'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0',
- 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','U','\0',
- 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0',
- 'G','U','L','I','M','.','T','T','C',',','G','u','l','i','m','\0',
- '\0'};
+ u"MSGOTHIC.TTC,MS UI Gothic\0MINGLIU.TTC,PMingLiU\0SIMSUN.TTC,SimSun\0GULIM.TTC,Gulim\0";
static const WCHAR system_link_korean[] =
- {'G','U','L','I','M','.','T','T','C',',','G','u','l','i','m','\0',
- 'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0',
- 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','U','\0',
- 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0',
- '\0'};
+ u"GULIM.TTC,Gulim\0MSGOTHIC.TTC,MS UI Gothic\0MINGLIU.TTC,PMingLiU\0SIMSUN.TTC,SimSun\0";
static const WCHAR system_link_non_cjk[] =
- {'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0',
- 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','U','\0',
- 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0',
- 'G','U','L','I','M','.','T','T','C',',','G','u','l','i','m','\0',
- '\0'};
+ u"MSGOTHIC.TTC,MS UI Gothic\0MINGLIU.TTC,PMingLiU\0SIMSUN.TTC,SimSun\0GULIM.TTC,Gulim\0";
HKEY hkey;
if (RegCreateKeyW(HKEY_LOCAL_MACHINE, system_link, &hkey) == ERROR_SUCCESS)
@@ -3998,7 +3964,7 @@ static void update_font_system_link_info(UINT current_ansi_codepage)
static void update_font_info(void)
{
- static const WCHAR logpixels[] = { 'L','o','g','P','i','x','e','l','s',0 };
+ static const WCHAR logpixels[] = u"LogPixels";
char buf[40], cpbuf[40];
DWORD len, type;
HKEY hkey = 0;
@@ -4199,8 +4165,8 @@ sym_not_found:
static void init_font_list(void)
{
- static const WCHAR dot_fonW[] = {'.','f','o','n','\0'};
- static const WCHAR pathW[] = {'P','a','t','h',0};
+ static const WCHAR dot_fonW[] = u".fon";
+ static const WCHAR pathW[] = u"Path";
HKEY hkey;
DWORD valuelen, datalen, i = 0, type, dlen, vlen;
WCHAR windowsdir[MAX_PATH];
@@ -4260,7 +4226,7 @@ static void init_font_list(void)
else if(dlen / 2 >= 6 && !strcmpiW(data + dlen / 2 - 5, dot_fonW))
{
WCHAR pathW[MAX_PATH];
- static const WCHAR fmtW[] = {'%','s','\\','%','s','\0'};
+ static const WCHAR fmtW[] = u"%s\\%s";
BOOL added = FALSE;
sprintfW(pathW, fmtW, windowsdir, data);
@@ -4391,9 +4357,8 @@ BOOL WineEngInit(void)
if (!RegOpenKeyExW(HKEY_CURRENT_USER, wine_fonts_key, 0, KEY_READ, &hkey))
{
- static const WCHAR antialias_fake_bold_or_italic[] = { 'A','n','t','i','a','l','i','a','s','F','a','k','e',
- 'B','o','l','d','O','r','I','t','a','l','i','c',0 };
- static const WCHAR true_options[] = { 'y','Y','t','T','1',0 };
+ static const WCHAR antialias_fake_bold_or_italic[] = u"AntialiasFakeBoldOrItalic";
+ static const WCHAR true_options[] = u"yYtT1";
DWORD type, size;
WCHAR buffer[20];
@@ -7934,7 +7899,7 @@ static BOOL get_outline_text_metrics(GdiFont *font)
full_nameW = get_face_name( ft_face, TT_NAME_ID_UNIQUE_ID, GetSystemDefaultLangID() );
if (!full_nameW)
{
- static const WCHAR fake_nameW[] = {'f','a','k','e',' ','n','a','m','e', 0};
+ static const WCHAR fake_nameW[] = u"fake name";
FIXME("failed to read full_nameW for font %s!\n", wine_dbgstr_w(font->name));
full_nameW = strdupW(fake_nameW);
}
diff --git a/dlls/gdi32/gdiobj.c b/dlls/gdi32/gdiobj.c
index 083a504569..0daa426111 100644
--- a/dlls/gdi32/gdiobj.c
+++ b/dlls/gdi32/gdiobj.c
@@ -128,17 +128,15 @@ static CRITICAL_SECTION gdi_section = { &critsect_debug, -1, 0, 0, 0, 0 };
static const LOGFONTW OEMFixedFont =
{ 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, OEM_CHARSET,
- 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, {'\0'} };
+ 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, u""};
static const LOGFONTW AnsiFixedFont =
{ 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
- 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'} };
+ 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, u"Courier"};
static const LOGFONTW AnsiVarFont =
{ 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
- 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'} };
+ 0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, u"MS Sans Serif"};
/******************************************************************************
*
@@ -173,308 +171,308 @@ static const struct DefaultFontInfo default_fonts[] =
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ EASTEUROPE_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, EASTEUROPE_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, EASTEUROPE_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, EASTEUROPE_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, EASTEUROPE_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ RUSSIAN_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, RUSSIAN_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, RUSSIAN_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, RUSSIAN_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, RUSSIAN_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ GREEK_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, GREEK_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, GREEK_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, GREEK_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, GREEK_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ TURKISH_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, TURKISH_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, TURKISH_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, TURKISH_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, TURKISH_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ HEBREW_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, HEBREW_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, HEBREW_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HEBREW_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HEBREW_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ ARABIC_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ARABIC_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ARABIC_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ARABIC_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ARABIC_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ BALTIC_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, BALTIC_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, BALTIC_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, BALTIC_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, BALTIC_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ THAI_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, THAI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, THAI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, THAI_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, THAI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ SHIFTJIS_CHARSET,
{ /* System */
18, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
18, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ GB2312_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, GB2312_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, GB2312_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, GB2312_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, GB2312_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ HANGEUL_CHARSET,
{ /* System */
16, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HANGEUL_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HANGEUL_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HANGEUL_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, HANGEUL_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ CHINESEBIG5_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, CHINESEBIG5_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, CHINESEBIG5_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, CHINESEBIG5_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, CHINESEBIG5_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
{ JOHAB_CHARSET,
{ /* System */
16, 7, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, JOHAB_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* Device Default */
16, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, JOHAB_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'S','y','s','t','e','m','\0'}
+ u"System"
},
{ /* System Fixed */
16, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, JOHAB_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN,
- {'C','o','u','r','i','e','r','\0'}
+ u"Courier"
},
{ /* DefaultGuiFont */
-12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, JOHAB_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
- {'M','S',' ','S','h','e','l','l',' ','D','l','g','\0'}
+ u"MS Shell Dlg"
},
},
};
@@ -598,9 +596,9 @@ BOOL GDI_dec_ref_count( HGDIOBJ handle )
return entry != NULL;
}
-static const WCHAR dpi_key_name[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\0'};
-static const WCHAR def_dpi_key_name[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
-static const WCHAR dpi_value_name[] = {'L','o','g','P','i','x','e','l','s','\0'};
+static const WCHAR dpi_key_name[] = u"Control Panel\\Desktop";
+static const WCHAR def_dpi_key_name[] = u"Software\\Fonts";
+static const WCHAR dpi_value_name[] = u"LogPixels";
/******************************************************************************
* get_reg_dword
@@ -653,7 +651,7 @@ DWORD get_system_dpi(void)
if (!pGetDpiForSystem)
{
- static const WCHAR user32W[] = {'u','s','e','r','3','2','.','d','l','l',0};
+ static const WCHAR user32W[] = u"user32.dll";
HMODULE user = GetModuleHandleW( user32W );
if (user) pGetDpiForSystem = (void *)GetProcAddress( user, "GetDpiForSystem" );
}
diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c
index 578737994a..dd23538b82 100644
--- a/dlls/gdi32/opengl.c
+++ b/dlls/gdi32/opengl.c
@@ -36,7 +36,7 @@
#include "gdi_private.h"
-static const WCHAR opengl32W[] = {'o','p','e','n','g','l','3','2','.','d','l','l',0};
+static const WCHAR opengl32W[] = u"opengl32.dll";
static HMODULE opengl32;
static INT (WINAPI *wglChoosePixelFormat)(HDC,const PIXELFORMATDESCRIPTOR *);
static INT (WINAPI *wglDescribePixelFormat)(HDC,INT,UINT,PIXELFORMATDESCRIPTOR*);
diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c
index cad6428dc9..b2c3882ad9 100644
--- a/dlls/gdi32/region.c
+++ b/dlls/gdi32/region.c
@@ -1437,7 +1437,7 @@ INT mirror_region( HRGN dst, HRGN src, INT width )
*/
BOOL WINAPI MirrorRgn( HWND hwnd, HRGN hrgn )
{
- static const WCHAR user32W[] = {'u','s','e','r','3','2','.','d','l','l',0};
+ static const WCHAR user32W[] = u"user32.dll";
static BOOL (WINAPI *pGetWindowRect)( HWND hwnd, LPRECT rect );
RECT rect;
--
2.20.1
April 1, 2019
[PATCH] virtdisk: Add stub for OpenVirtualDisk
by Vijay Kiran Kamuju
From: Louis Lenders <xerox.xerox2000x(a)gmail.com>
From: Louis Lenders <xerox.xerox2000x(a)gmail.com>
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45947
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com>
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
---
dlls/virtdisk/virtdisk.spec | 2 +-
dlls/virtdisk/virtdisk_main.c | 7 ++++++
include/virtdisk.h | 44 +++++++++++++++++++++++++++++++++++
3 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/dlls/virtdisk/virtdisk.spec b/dlls/virtdisk/virtdisk.spec
index 6bd5f146db..f35b8df524 100644
--- a/dlls/virtdisk/virtdisk.spec
+++ b/dlls/virtdisk/virtdisk.spec
@@ -15,7 +15,7 @@
@ stub GetVirtualDiskPhysicalPath
@ stub MergeVirtualDisk
@ stub MirrorVirtualDisk
-@ stub OpenVirtualDisk
+@ stdcall OpenVirtualDisk(ptr wstr long long ptr ptr)
@ stub ResizeVirtualDisk
@ stub SetVirtualDiskInformation
@ stub SetVirtualDiskMetadata
diff --git a/dlls/virtdisk/virtdisk_main.c b/dlls/virtdisk/virtdisk_main.c
index 3e6c5c14dc..1523fd42a4 100644
--- a/dlls/virtdisk/virtdisk_main.c
+++ b/dlls/virtdisk/virtdisk_main.c
@@ -65,3 +65,10 @@ DWORD WINAPI GetStorageDependencyInformation(HANDLE obj, GET_STORAGE_DEPENDENCY_
return ERROR_SUCCESS;
}
+
+DWORD WINAPI OpenVirtualDisk(VIRTUAL_STORAGE_TYPE *type, const WCHAR *path, VIRTUAL_DISK_ACCESS_MASK mask, OPEN_VIRTUAL_DISK_FLAG flags,
+ OPEN_VIRTUAL_DISK_PARAMETERS *param, HANDLE *handle)
+{
+ FIXME("(%p, %s, %d, 0x%x, %p, %p): stub\n", type, wine_dbgstr_w(path), mask, flags, param, handle);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
diff --git a/include/virtdisk.h b/include/virtdisk.h
index b4c07f3b69..7c207dd879 100644
--- a/include/virtdisk.h
+++ b/include/virtdisk.h
@@ -37,6 +37,26 @@ typedef enum _ATTACH_VIRTUAL_DISK_FLAG {
ATTACH_VIRTUAL_DISK_FLAG_NO_SECURITY_DESCRIPTOR = 0x10
} ATTACH_VIRTUAL_DISK_FLAG;
+typedef enum _OPEN_VIRTUAL_DISK_FLAG {
+ OPEN_VIRTUAL_DISK_FLAG_NONE = 0x00,
+ OPEN_VIRTUAL_DISK_FLAG_NO_PARENTS = 0x01,
+ OPEN_VIRTUAL_DISK_FLAG_BLANK_FILE = 0x02,
+ OPEN_VIRTUAL_DISK_FLAG_BOOT_DRIVE = 0x04,
+ OPEN_VIRTUAL_DISK_FLAG_CACHED_IO = 0x08,
+ OPEN_VIRTUAL_DISK_FLAG_CUSTOM_DIFF_CHAIN = 0x10,
+ OPEN_VIRTUAL_DISK_FLAG_PARENT_CACHED_IO = 0x20,
+ OPEN_VIRTUAL_DISK_FLAG_VHDSET_FILE_ONLY = 0x40,
+ OPEN_VIRTUAL_DISK_FLAG_IGNORE_RELATIVE_PARENT_LOCATOR = 0x80,
+ OPEN_VIRTUAL_DISK_FLAG_NO_WRITE_HARDENING = 0x100
+} OPEN_VIRTUAL_DISK_FLAG;
+
+typedef enum _OPEN_VIRTUAL_DISK_VERSION {
+ OPEN_VIRTUAL_DISK_VERSION_UNSCPECIFIED,
+ OPEN_VIRTUAL_DISK_VERSION_1,
+ OPEN_VIRTUAL_DISK_VERSION_2,
+ OPEN_VIRTUAL_DISK_VERSION_3
+} OPEN_VIRTUAL_DISK_VERSION;
+
typedef enum _ATTACH_VIRTUAL_DISK_VERSION {
ATTACH_VIRTUAL_DISK_VERSION_UNSPECIFIED,
ATTACH_VIRTUAL_DISK_VERSION_1
@@ -156,6 +176,27 @@ typedef struct _EXPAND_VIRTUAL_DISK_PARAMETERS {
} DUMMYUNIONNAME;
} EXPAND_VIRTUAL_DISK_PARAMETERS, *PEXPAND_VIRTUAL_DISK_PARAMETERS;
+typedef struct _OPEN_VIRTUAL_DISK_PARAMETERS
+{
+ OPEN_VIRTUAL_DISK_VERSION Version;
+ __C89_NAMELESS union {
+ struct {
+ ULONG RWDepth;
+ } Version1;
+ struct {
+ BOOL GetInfoOnly;
+ BOOL ReadOnly;
+ GUID ResiliencyGuid;
+ } Version2;
+ struct {
+ BOOL GetInfoOnly;
+ BOOL ReadOnly;
+ GUID ResiliencyGuid;
+ GUID SnapshotId;
+ } Version3;
+ } DUMMYUNIONNAME;
+} OPEN_VIRTUAL_DISK_PARAMETERS, *POPEN_VIRTUAL_DISK_PARAMETERS;
+
typedef struct _STORAGE_DEPENDENCY_INFO_TYPE_1
{
DEPENDENT_DISK_FLAG DependencyTypeFlags;
@@ -196,6 +237,9 @@ typedef struct _VIRTUAL_DISK_PROGRESS {
DWORD WINAPI GetStorageDependencyInformation(HANDLE obj, GET_STORAGE_DEPENDENCY_FLAG flags, ULONG size, STORAGE_DEPENDENCY_INFO *info, ULONG *used);
+DWORD WINAPI OpenVirtualDisk(VIRTUAL_STORAGE_TYPE *type, const WCHAR *path, VIRTUAL_DISK_ACCESS_MASK mask, OPEN_VIRTUAL_DISK_FLAG flags,
+ OPEN_VIRTUAL_DISK_PARAMETERS *param, HANDLE *handle);
+
#ifdef __cplusplus
}
#endif
--
2.21.0
April 1, 2019
[PATCH] version: Correctly return VFF_CURNEDEST in VerFindFileA.
by Vijay Kiran Kamuju
From: Michael Müller <michael(a)fds-team.de>
From: Michael Müller <michael(a)fds-team.de>
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
---
dlls/version/tests/Makefile.in | 2 +-
dlls/version/tests/install.c | 151 +++++++++++++++++++++++++++++++--
dlls/version/version.c | 38 +++++----
3 files changed, 169 insertions(+), 22 deletions(-)
diff --git a/dlls/version/tests/Makefile.in b/dlls/version/tests/Makefile.in
index 3c155c9da0..a1e24f9be2 100644
--- a/dlls/version/tests/Makefile.in
+++ b/dlls/version/tests/Makefile.in
@@ -1,5 +1,5 @@
TESTDLL = version.dll
-IMPORTS = version
+IMPORTS = version shell32
C_SRCS = \
info.c \
diff --git a/dlls/version/tests/install.c b/dlls/version/tests/install.c
index 9b84dce492..b06125ff50 100644
--- a/dlls/version/tests/install.c
+++ b/dlls/version/tests/install.c
@@ -24,11 +24,13 @@
#include "winbase.h"
#include "winerror.h"
#include "winver.h"
+#include "shlobj.h"
static void test_find_file(void)
{
DWORD ret;
UINT dwCur, dwOut ;
+ char tmp[MAX_PATH];
char appdir[MAX_PATH];
char curdir[MAX_PATH];
char filename[MAX_PATH];
@@ -115,10 +117,11 @@ static void test_find_file(void)
}
}
}
- if(!GetModuleFileNameA(NULL, filename, MAX_PATH) ||
- !GetSystemDirectoryA(windir, MAX_PATH) ||
- !GetTempPathA(MAX_PATH, appdir))
- trace("GetModuleFileNameA, GetSystemDirectoryA or GetTempPathA failed\n");
+ if(!GetSystemDirectoryA(windir, MAX_PATH) ||
+ !SHGetSpecialFolderPathA(0, appdir, CSIDL_PROGRAM_FILES, FALSE) ||
+ !GetTempPathA(MAX_PATH, tmp) ||
+ !GetTempFileNameA(tmp, "tes", 0, filename))
+ ok(0, "GetSystemDirectoryA, SHGetSpecialFolderPathA, GetTempPathA or GetTempFileNameA failed\n");
else {
char *p = strrchr(filename, '\\');
if(p) {
@@ -150,7 +153,7 @@ static void test_find_file(void)
memset(outBuf, 0, MAX_PATH);
memset(curdir, 0, MAX_PATH);
ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
- todo_wine ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected VFF_CURNEDEST\n", ret);
+ ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected VFF_CURNEDEST\n", ret);
ok(dwOut == 1 + strlen(windir), "Wrong length of buffer for current location: "
"got %d(%s) expected %d\n", dwOut, outBuf, lstrlenA(windir)+1);
@@ -159,9 +162,145 @@ static void test_find_file(void)
memset(outBuf, 0, MAX_PATH);
memset(curdir, 0, MAX_PATH);
ret = VerFindFileA(0, filename, NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
- todo_wine ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected VFF_CURNEDEST\n", ret);
+ ok(VFF_CURNEDEST == ret, "Wrong return value got %x expected VFF_CURNEDEST\n", ret);
ok(dwOut == 1 + strlen(appdir), "Wrong length of buffer for current location: "
"got %d(%s) expected %d\n", dwOut, outBuf, lstrlenA(appdir)+1);
+
+ /* search for filename */
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, filename, NULL, NULL, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, filename, NULL, empty, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, filename, NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, NULL, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, empty, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, filename, NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ /* search for regedit */
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit", NULL, NULL, curdir, &dwCur, outBuf, &dwOut);
+ ok(!ret, "Wrong return value got %x expected 0\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit", NULL, empty, curdir, &dwCur, outBuf, &dwOut);
+ ok(!ret, "Wrong return value got %x expected 0\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit", NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit", NULL, NULL, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit", NULL, empty, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit", NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ /* search for regedit.exe */
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit.exe", NULL, NULL, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit.exe", NULL, empty, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "regedit.exe", NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit.exe", NULL, NULL, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit.exe", NULL, empty, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "regedit.exe", NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ /* nonexistent filename */
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "doesnotexist.exe", NULL, NULL, curdir, &dwCur, outBuf, &dwOut);
+ ok(!ret, "Wrong return value got %x expected 0\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "doesnotexist.exe", NULL, empty, curdir, &dwCur, outBuf, &dwOut);
+ ok(!ret, "Wrong return value got %x expected 0\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "doesnotexist.exe", NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(0, "doesnotexist.exe", NULL, "C:\\random_path_does_not_exist", curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, NULL, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, empty, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, appdir, curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ dwCur=MAX_PATH;
+ dwOut=MAX_PATH;
+ ret = VerFindFileA(VFFF_ISSHAREDFILE, "doesnotexist.exe", NULL, "C:\\random_path_does_not_exist", curdir, &dwCur, outBuf, &dwOut);
+ ok(ret & VFF_CURNEDEST, "Wrong return value got %x expected VFF_CURNEDEST set\n", ret);
+
+ DeleteFileA(filename);
}
}
diff --git a/dlls/version/version.c b/dlls/version/version.c
index bd03b2be80..68dd4a8df8 100644
--- a/dlls/version/version.c
+++ b/dlls/version/version.c
@@ -1128,16 +1128,22 @@ static int testFileExistenceA( char const * path, char const * file, BOOL excl )
fileinfo.cBytes = sizeof(OFSTRUCT);
- strcpy(filename, path);
- filenamelen = strlen(filename);
+ if (path)
+ {
+ strcpy(filename, path);
+ filenamelen = strlen(filename);
- /* Add a trailing \ if necessary */
- if(filenamelen) {
- if(filename[filenamelen - 1] != '\\')
- strcat(filename, "\\");
+ /* Add a trailing \ if necessary */
+ if(filenamelen)
+ {
+ if(filename[filenamelen - 1] != '\\')
+ strcat(filename, "\\");
+ }
+ else /* specify the current directory */
+ strcpy(filename, ".\\");
}
- else /* specify the current directory */
- strcpy(filename, ".\\");
+ else
+ filename[0] = 0;
/* Create the full pathname */
strcat(filename, file);
@@ -1227,10 +1233,10 @@ DWORD WINAPI VerFindFileA(
{
if(testFileExistenceA(destDir, lpszFilename, FALSE)) curDir = destDir;
else if(lpszAppDir && testFileExistenceA(lpszAppDir, lpszFilename, FALSE))
- {
curDir = lpszAppDir;
+
+ if(!testFileExistenceA(systemDir, lpszFilename, FALSE))
retval |= VFF_CURNEDEST;
- }
}
}
else /* not a shared file */
@@ -1241,15 +1247,17 @@ DWORD WINAPI VerFindFileA(
GetWindowsDirectoryA( winDir, MAX_PATH );
if(testFileExistenceA(destDir, lpszFilename, FALSE)) curDir = destDir;
else if(testFileExistenceA(winDir, lpszFilename, FALSE))
- {
curDir = winDir;
- retval |= VFF_CURNEDEST;
- }
else if(testFileExistenceA(systemDir, lpszFilename, FALSE))
- {
curDir = systemDir;
- retval |= VFF_CURNEDEST;
+
+ if (lpszAppDir && lpszAppDir[0])
+ {
+ if(!testFileExistenceA(lpszAppDir, lpszFilename, FALSE))
+ retval |= VFF_CURNEDEST;
}
+ else if(testFileExistenceA(NULL, lpszFilename, FALSE))
+ retval |= VFF_CURNEDEST;
}
}
--
2.21.0
April 1, 2019
[PATCH 8/8] oleaut32/tests: Test marshalling of complex structs.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/oleaut32/tests/tmarshal.c | 45 ++++++++++++++++++++++++++++++++
dlls/oleaut32/tests/tmarshal.idl | 21 ++++++++++++++-
2 files changed, 65 insertions(+), 1 deletion(-)
diff --git a/dlls/oleaut32/tests/tmarshal.c b/dlls/oleaut32/tests/tmarshal.c
index 9a7d995ca8..4f84442baf 100644
--- a/dlls/oleaut32/tests/tmarshal.c
+++ b/dlls/oleaut32/tests/tmarshal.c
@@ -1441,6 +1441,28 @@ static HRESULT WINAPI Widget_rect(IWidget *iface, RECT in, RECT *out, RECT *in_p
return S_OK;
}
+static HRESULT WINAPI Widget_complex_struct(IWidget *iface, struct complex in)
+{
+ HRESULT hr;
+
+ ok(in.c == 98, "Got char %d.\n", in.c);
+ ok(in.i == 76543, "Got int %d.\n", in.i);
+ ok(*in.pi == 2, "Got int pointer %d.\n", *in.pi);
+ ok(**in.ppi == 10, "Got int double pointer %d.\n", **in.ppi);
+ hr = ISomethingFromDispatch_anotherfn(in.iface);
+ ok(hr == 0x01234567, "Got wrong hr %#x.\n", hr);
+ hr = ISomethingFromDispatch_anotherfn(*in.iface_ptr);
+ ok(hr == 0x01234567, "Got wrong hr %#x.\n", hr);
+ ok(!lstrcmpW(in.bstr, test_bstr2), "Got string %s.\n", wine_dbgstr_w(in.bstr));
+ ok(V_VT(&in.var) == VT_I4, "Got wrong type %u.\n", V_VT(&in.var));
+ ok(V_I4(&in.var) == 123, "Got wrong value %d.\n", V_I4(&in.var));
+ ok(!memcmp(&in.mystruct, &test_mystruct1, sizeof(MYSTRUCT)), "Structs didn't match.\n");
+ ok(!memcmp(in.arr, test_array1, sizeof(array_t)), "Arrays didn't match.\n");
+ ok(in.myint == 456, "Got int %d.\n", in.myint);
+
+ return S_OK;
+}
+
static HRESULT WINAPI Widget_array(IWidget *iface, array_t in, array_t out, array_t in_out)
{
static const array_t empty = {0};
@@ -1600,6 +1622,7 @@ static const struct IWidgetVtbl Widget_VTable =
Widget_mystruct_ptr_ptr,
Widget_thin_struct,
Widget_rect,
+ Widget_complex_struct,
Widget_array,
Widget_variant_array,
Widget_mystruct_array,
@@ -2500,6 +2523,9 @@ static void test_marshal_struct(IWidget *widget, IDispatch *disp)
{
MYSTRUCT out, in_ptr, in_out, *in_ptr_ptr;
RECT rect_out, rect_in_ptr, rect_in_out;
+ ISomethingFromDispatch *sfd;
+ struct complex complex;
+ int i, i2, *pi = &i2;
HRESULT hr;
memcpy(&out, &test_mystruct2, sizeof(MYSTRUCT));
@@ -2531,6 +2557,25 @@ static void test_marshal_struct(IWidget *widget, IDispatch *disp)
ok(EqualRect(&rect_out, &test_rect5), "Rects didn't match.\n");
ok(EqualRect(&rect_in_ptr, &test_rect3), "Rects didn't match.\n");
ok(EqualRect(&rect_in_out, &test_rect7), "Rects didn't match.\n");
+
+ /* Test complex structs. */
+ complex.c = 98;
+ complex.i = 76543;
+ i = 2;
+ complex.pi = &i;
+ i2 = 10;
+ complex.ppi = π
+ complex.iface = create_disp_obj();
+ sfd = create_disp_obj();
+ complex.iface_ptr = &sfd;
+ complex.bstr = SysAllocString(test_bstr2);
+ V_VT(&complex.var) = VT_I4;
+ V_I4(&complex.var) = 123;
+ memcpy(&complex.mystruct, &test_mystruct1, sizeof(MYSTRUCT));
+ memcpy(complex.arr, test_array1, sizeof(array_t));
+ complex.myint = 456;
+ hr = IWidget_complex_struct(widget, complex);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
}
static void test_marshal_array(IWidget *widget, IDispatch *disp)
diff --git a/dlls/oleaut32/tests/tmarshal.idl b/dlls/oleaut32/tests/tmarshal.idl
index cdc7dc14d3..14b80c4eec 100644
--- a/dlls/oleaut32/tests/tmarshal.idl
+++ b/dlls/oleaut32/tests/tmarshal.idl
@@ -65,6 +65,7 @@ enum IWidget_dispids
DISPID_TM_STRUCT_PTR_PTR,
DISPID_TM_THIN_STRUCT,
DISPID_TM_RECT,
+ DISPID_TM_COMPLEX_STRUCT,
DISPID_TM_ARRAY,
DISPID_TM_VARIANT_ARRAY,
DISPID_TM_STRUCT_ARRAY,
@@ -105,6 +106,8 @@ library TestTypelib
typedef [public] int myint_t;
+ typedef int array_t[4];
+
coclass ApplicationObject2;
[
@@ -335,7 +338,23 @@ library TestTypelib
[id(DISPID_TM_RECT)]
HRESULT rect([in] RECT in, [out] RECT *out, [in] RECT *in_ptr, [in, out] RECT *in_out);
- typedef int array_t[4];
+ struct complex
+ {
+ char c;
+ int i;
+ int *pi;
+ int **ppi;
+ ISomethingFromDispatch *iface;
+ ISomethingFromDispatch **iface_ptr;
+ BSTR bstr;
+ VARIANT var;
+ MYSTRUCT mystruct;
+ array_t arr;
+ myint_t myint;
+ };
+
+ [id(DISPID_TM_COMPLEX_STRUCT)]
+ HRESULT complex_struct([in] struct complex in);
[id(DISPID_TM_ARRAY)]
HRESULT array([in] array_t in, [out] array_t out, [in, out] array_t in_out);
--
2.20.1
April 1, 2019
[PATCH 7/8] rpcrt4: Write type format strings for complex structs.
by Zebediah Figura
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46378
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/rpcrt4/ndr_typelib.c | 231 ++++++++++++++++++++++++++++++++++++--
1 file changed, 221 insertions(+), 10 deletions(-)
diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c
index 3d3d42b97a..5a4de51dd1 100644
--- a/dlls/rpcrt4/ndr_typelib.c
+++ b/dlls/rpcrt4/ndr_typelib.c
@@ -355,24 +355,42 @@ static unsigned char get_array_fc(ITypeInfo *typeinfo, TYPEDESC *desc)
return FC_BOGUS_ARRAY;
}
-static size_t write_struct_tfs(ITypeInfo *typeinfo, unsigned char *str,
+static BOOL type_is_non_iface_pointer(ITypeInfo *typeinfo, TYPEDESC *desc)
+{
+ if (desc->vt == VT_PTR)
+ return !type_pointer_is_iface(typeinfo, desc->lptdesc);
+ else if (desc->vt == VT_USERDEFINED)
+ {
+ ITypeInfo *refinfo;
+ TYPEATTR *attr;
+ BOOL ret;
+
+ ITypeInfo_GetRefTypeInfo(typeinfo, desc->hreftype, &refinfo);
+ ITypeInfo_GetTypeAttr(refinfo, &attr);
+
+ if (attr->typekind == TKIND_ALIAS)
+ ret = type_is_non_iface_pointer(refinfo, &attr->tdescAlias);
+ else
+ ret = FALSE;
+
+ ITypeInfo_ReleaseTypeAttr(refinfo, attr);
+ ITypeInfo_Release(refinfo);
+
+ return ret;
+ }
+ else
+ return FALSE;
+}
+
+static void write_struct_members(ITypeInfo *typeinfo, unsigned char *str,
size_t *len, TYPEATTR *attr)
{
- unsigned char fc = get_struct_fc(typeinfo, attr);
unsigned int struct_offset = 0;
unsigned char basetype;
- size_t off = *len;
TYPEDESC *tdesc;
VARDESC *desc;
WORD i;
- if (fc != FC_STRUCT)
- FIXME("fc %02x not implemented\n", fc);
-
- WRITE_CHAR (str, *len, FC_STRUCT);
- WRITE_CHAR (str, *len, attr->cbAlignment - 1);
- WRITE_SHORT(str, *len, attr->cbSizeInstance);
-
for (i = 0; i < attr->cVars; i++)
{
ITypeInfo_GetVarDesc(typeinfo, i, &desc);
@@ -391,12 +409,205 @@ static size_t write_struct_tfs(ITypeInfo *typeinfo, unsigned char *str,
if ((basetype = get_basetype(typeinfo, tdesc)))
WRITE_CHAR(str, *len, basetype);
+ else if (type_is_non_iface_pointer(typeinfo, tdesc))
+ WRITE_CHAR(str, *len, FC_POINTER);
+ else
+ {
+ WRITE_CHAR(str, *len, FC_EMBEDDED_COMPLEX);
+ WRITE_CHAR(str, *len, 0);
+ WRITE_SHORT(str, *len, 0);
+ }
ITypeInfo_ReleaseVarDesc(typeinfo, desc);
}
if (!(*len & 1))
WRITE_CHAR (str, *len, FC_PAD);
WRITE_CHAR (str, *len, FC_END);
+}
+
+static void write_simple_struct_tfs(ITypeInfo *typeinfo, unsigned char *str,
+ size_t *len, TYPEATTR *attr)
+{
+ write_struct_members(typeinfo, str, len, attr);
+}
+
+static BOOL type_needs_pointer_deref(ITypeInfo *typeinfo, TYPEDESC *desc)
+{
+ if (desc->vt == VT_PTR || desc->vt == VT_UNKNOWN || desc->vt == VT_DISPATCH)
+ return TRUE;
+ else if (desc->vt == VT_USERDEFINED)
+ {
+ ITypeInfo *refinfo;
+ BOOL ret = FALSE;
+ TYPEATTR *attr;
+
+ ITypeInfo_GetRefTypeInfo(typeinfo, desc->hreftype, &refinfo);
+ ITypeInfo_GetTypeAttr(refinfo, &attr);
+
+ if (attr->typekind == TKIND_ALIAS)
+ ret = type_needs_pointer_deref(refinfo, &attr->tdescAlias);
+
+ ITypeInfo_ReleaseTypeAttr(refinfo, attr);
+ ITypeInfo_Release(refinfo);
+
+ return ret;
+ }
+ else
+ return FALSE;
+}
+
+static void write_complex_struct_pointer_layout(ITypeInfo *typeinfo,
+ TYPEDESC *desc, unsigned char *str, size_t *len)
+{
+ unsigned char basetype;
+
+ if (desc->vt == VT_PTR && !type_pointer_is_iface(typeinfo, desc->lptdesc))
+ {
+ WRITE_CHAR(str, *len, FC_UP);
+ if ((basetype = get_basetype(typeinfo, desc->lptdesc)))
+ {
+ WRITE_CHAR(str, *len, FC_SIMPLE_POINTER);
+ WRITE_CHAR(str, *len, basetype);
+ WRITE_CHAR(str, *len, FC_PAD);
+ }
+ else
+ {
+ if (type_needs_pointer_deref(typeinfo, desc->lptdesc))
+ WRITE_CHAR(str, *len, FC_POINTER_DEREF);
+ else
+ WRITE_CHAR(str, *len, 0);
+ WRITE_SHORT(str, *len, 0);
+ }
+ }
+ else if (desc->vt == VT_USERDEFINED)
+ {
+ ITypeInfo *refinfo;
+ TYPEATTR *attr;
+
+ ITypeInfo_GetRefTypeInfo(typeinfo, desc->hreftype, &refinfo);
+ ITypeInfo_GetTypeAttr(refinfo, &attr);
+
+ if (attr->typekind == TKIND_ALIAS)
+ write_complex_struct_pointer_layout(refinfo, &attr->tdescAlias, str, len);
+
+ ITypeInfo_ReleaseTypeAttr(refinfo, attr);
+ ITypeInfo_Release(refinfo);
+ }
+}
+
+static size_t write_complex_struct_pointer_ref(ITypeInfo *typeinfo,
+ TYPEDESC *desc, unsigned char *str, size_t *len)
+{
+ if (desc->vt == VT_PTR && !type_pointer_is_iface(typeinfo, desc->lptdesc)
+ && !get_basetype(typeinfo, desc->lptdesc))
+ {
+ return write_type_tfs(typeinfo, str, len, desc->lptdesc, FALSE, FALSE);
+ }
+ else if (desc->vt == VT_USERDEFINED)
+ {
+ ITypeInfo *refinfo;
+ TYPEATTR *attr;
+ size_t ret = 0;
+
+ ITypeInfo_GetRefTypeInfo(typeinfo, desc->hreftype, &refinfo);
+ ITypeInfo_GetTypeAttr(refinfo, &attr);
+
+ if (attr->typekind == TKIND_ALIAS)
+ ret = write_complex_struct_pointer_ref(refinfo, &attr->tdescAlias, str, len);
+
+ ITypeInfo_ReleaseTypeAttr(refinfo, attr);
+ ITypeInfo_Release(refinfo);
+
+ return ret;
+ }
+
+ return 0;
+}
+
+static void write_complex_struct_tfs(ITypeInfo *typeinfo, unsigned char *str,
+ size_t *len, TYPEATTR *attr)
+{
+ size_t pointer_layout_offset, pointer_layout, member_layout, ref;
+ unsigned int struct_offset = 0;
+ TYPEDESC *tdesc;
+ VARDESC *desc;
+ WORD i;
+
+ WRITE_SHORT(str, *len, 0); /* conformant array description */
+ pointer_layout_offset = *len;
+ WRITE_SHORT(str, *len, 0); /* pointer layout; will be filled in later */
+ member_layout = *len;
+
+ /* First pass: write the struct members and pointer layout, but do not yet
+ * write the offsets for embedded complexes and pointer refs. These must be
+ * handled after we write the whole struct description, since it must be
+ * contiguous. */
+
+ write_struct_members(typeinfo, str, len, attr);
+
+ pointer_layout = *len;
+ if (str) *((short *)(str + pointer_layout_offset)) = pointer_layout - pointer_layout_offset;
+
+ for (i = 0; i < attr->cVars; i++)
+ {
+ ITypeInfo_GetVarDesc(typeinfo, i, &desc);
+ write_complex_struct_pointer_layout(typeinfo, &desc->elemdescVar.tdesc, str, len);
+ ITypeInfo_ReleaseVarDesc(typeinfo, desc);
+ }
+
+ /* Second pass: write types for embedded complexes and non-simple pointers. */
+
+ struct_offset = 0;
+
+ for (i = 0; i < attr->cVars; i++)
+ {
+ ITypeInfo_GetVarDesc(typeinfo, i, &desc);
+ tdesc = &desc->elemdescVar.tdesc;
+
+ if (struct_offset != desc->oInst)
+ member_layout++; /* alignment directive */
+ struct_offset = desc->oInst + type_memsize(typeinfo, tdesc);
+
+ if (get_basetype(typeinfo, tdesc))
+ member_layout++;
+ else if (type_is_non_iface_pointer(typeinfo, tdesc))
+ {
+ member_layout++;
+ if ((ref = write_complex_struct_pointer_ref(typeinfo, tdesc, str, len)))
+ {
+ if (str) *((short *)(str + pointer_layout + 2)) = ref - (pointer_layout + 2);
+ }
+ pointer_layout += 4;
+ }
+ else
+ {
+ ref = write_type_tfs(typeinfo, str, len, tdesc, FALSE, FALSE);
+ if (str) *((short *)(str + member_layout + 2)) = ref - (member_layout + 2);
+ member_layout += 4;
+ }
+
+ ITypeInfo_ReleaseVarDesc(typeinfo, desc);
+ }
+}
+
+static size_t write_struct_tfs(ITypeInfo *typeinfo, unsigned char *str,
+ size_t *len, TYPEATTR *attr)
+{
+ unsigned char fc = get_struct_fc(typeinfo, attr);
+ size_t off = *len;
+
+ /* For the sake of simplicity, write pointer structs as complex structs. */
+ if (fc == FC_PSTRUCT)
+ fc = FC_BOGUS_STRUCT;
+
+ WRITE_CHAR (str, *len, fc);
+ WRITE_CHAR (str, *len, attr->cbAlignment - 1);
+ WRITE_SHORT(str, *len, attr->cbSizeInstance);
+
+ if (fc == FC_STRUCT)
+ write_simple_struct_tfs(typeinfo, str, len, attr);
+ else if (fc == FC_BOGUS_STRUCT)
+ write_complex_struct_tfs(typeinfo, str, len, attr);
return off;
}
--
2.20.1
April 1, 2019
[PATCH 6/8] rpcrt4: Write parameters for fixed structs.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/rpcrt4/ndr_typelib.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c
index 8f87693a6b..3d3d42b97a 100644
--- a/dlls/rpcrt4/ndr_typelib.c
+++ b/dlls/rpcrt4/ndr_typelib.c
@@ -246,6 +246,7 @@ static unsigned char get_struct_member_fc(ITypeInfo *typeinfo, TYPEDESC *tdesc)
return (sizeof(void *) == 4) ? FC_PSTRUCT : FC_BOGUS_STRUCT;
case VT_CY:
return FC_STRUCT;
+ case VT_VARIANT:
case VT_UNKNOWN:
case VT_DISPATCH:
return FC_BOGUS_STRUCT;
@@ -358,7 +359,12 @@ static size_t write_struct_tfs(ITypeInfo *typeinfo, unsigned char *str,
size_t *len, TYPEATTR *attr)
{
unsigned char fc = get_struct_fc(typeinfo, attr);
+ unsigned int struct_offset = 0;
+ unsigned char basetype;
size_t off = *len;
+ TYPEDESC *tdesc;
+ VARDESC *desc;
+ WORD i;
if (fc != FC_STRUCT)
FIXME("fc %02x not implemented\n", fc);
@@ -366,7 +372,30 @@ static size_t write_struct_tfs(ITypeInfo *typeinfo, unsigned char *str,
WRITE_CHAR (str, *len, FC_STRUCT);
WRITE_CHAR (str, *len, attr->cbAlignment - 1);
WRITE_SHORT(str, *len, attr->cbSizeInstance);
- WRITE_CHAR (str, *len, FC_PAD);
+
+ for (i = 0; i < attr->cVars; i++)
+ {
+ ITypeInfo_GetVarDesc(typeinfo, i, &desc);
+ tdesc = &desc->elemdescVar.tdesc;
+
+ /* This may not match the intended alignment, but we don't have enough
+ * information to determine that. This should always give the correct
+ * layout. */
+ if ((struct_offset & 7) && !(desc->oInst & 7))
+ WRITE_CHAR(str, *len, FC_ALIGNM8);
+ else if ((struct_offset & 3) && !(desc->oInst & 3))
+ WRITE_CHAR(str, *len, FC_ALIGNM4);
+ else if ((struct_offset & 1) && !(desc->oInst & 1))
+ WRITE_CHAR(str, *len, FC_ALIGNM2);
+ struct_offset = desc->oInst + type_memsize(typeinfo, tdesc);
+
+ if ((basetype = get_basetype(typeinfo, tdesc)))
+ WRITE_CHAR(str, *len, basetype);
+
+ ITypeInfo_ReleaseVarDesc(typeinfo, desc);
+ }
+ if (!(*len & 1))
+ WRITE_CHAR (str, *len, FC_PAD);
WRITE_CHAR (str, *len, FC_END);
return off;
--
2.20.1
April 1, 2019