But I am not completely sure if the generated instdlg.o
is valid and expected, and nsis needs to be able to handle it.
Or GNU assembler should really generate object files in the old layout?


Just a short addition:

If GNU assembler and nsis is found to be working as expected
and there exists no other notation to create wide strings,
attached patch might be to considered for win32-loader,
which avoids the irpc by embedding the null bytes manually
in the ascii strings to mimic a wide string.

Kind regards,
Bernhard
--- helpers/instdlg/instdlg.s.orig	2024-08-12 00:07:12.000000000 +0200
+++ helpers/instdlg/instdlg.s	2024-08-12 00:23:11.000000000 +0200
@@ -50,13 +50,6 @@ _WinMainCRTStartup:
 .set	WS_VISIBLE,		0x10000000
 .set	WS_CHILD,		0x40000000
 
-.macro WIDESTRING String
-.irpc    Character,"\String"
-.asciz  "\Character"
-.endr
-.short 	0
-.endm
-
 .macro	IMAGE_RESOURCE_DIRECTORY Characteristics=0, TimeDateStamp=0, MajorVersion=0, MinorVersion=0, NumberOfNamedEntries=0, NumberOfIdEntries=0
 .long	\Characteristics
 .long	\TimeDateStamp
@@ -78,7 +71,7 @@ _WinMainCRTStartup:
 .long	\Reserved
 .endm
 
-.macro	DLGTEMPLATEEX_WITH_FONT dlgVer=1, signature=0xFFFF, helpID=0, exStyle=0, style=0, cDlgItems=0, x=0, y=0, cx=0, cy=0, menu=0, windowClass=0, title="", pointsize=0, weight=0, italic=0, charset=0, typeface=""
+.macro	DLGTEMPLATEEX_WITH_FONT dlgVer=1, signature=0xFFFF, helpID=0, exStyle=0, style=0, cDlgItems=0, x=0, y=0, cx=0, cy=0, menu=0, windowClass=0, title="\0", pointsize=0, weight=0, italic=0, charset=0, typeface="\0"
 .short	\dlgVer
 .short	\signature
 .long	\helpID
@@ -91,15 +84,15 @@ _WinMainCRTStartup:
 .short	\cy
 .short	\menu
 .short	\windowClass
-WIDESTRING "\title"
+.asciz	"\title"
 .short	\pointsize
 .short	\weight
 .byte	\italic
 .byte	\charset
-WIDESTRING "\typeface"
+.asciz	"\typeface"
 .endm
 
-.macro	DLGITEMTEMPLATEEX helpID=0, exStyle=0, style=0, x=0, y=0, cx=0, cy=0, id=0, windowClass=0, title="", extraCount=0
+.macro	DLGITEMTEMPLATEEX helpID=0, exStyle=0, style=0, x=0, y=0, cx=0, cy=0, id=0, windowClass=0, title="\0", extraCount=0
 .long	\helpID
 .long	\exStyle
 .long	\style
@@ -110,11 +103,11 @@ WIDESTRING "\typeface"
 .long	\id
 .short	0xFFFF
 .short	\windowClass
-WIDESTRING "\title"
+.asciz	"\title"
 .short	\extraCount
 .endm
 
-.macro	DLGITEMTEMPLATEEX_SZCLASS helpID=0, exStyle=0, style=0, x=0, y=0, cx=0, cy=0, id=0, windowClass="", title="", extraCount=0
+.macro	DLGITEMTEMPLATEEX_SZCLASS helpID=0, exStyle=0, style=0, x=0, y=0, cx=0, cy=0, id=0, windowClass="\0", title="\0", extraCount=0
 .long	\helpID
 .long	\exStyle
 .long	\style
@@ -123,17 +116,19 @@ WIDESTRING "\title"
 .short	\cx
 .short	\cy
 .long	\id
-WIDESTRING "\windowClass"
-WIDESTRING "\title"
+.asciz	"\windowClass"
+.asciz	"\title"
 .short	\extraCount
 .endm
 
-.macro	DLGITEMTEMPLATEEX_PROGRESSBAR helpID=0, exStyle=0, style=0, x=0, y=0, cx=0, cy=0, id=0, title="", extraCount=0
-DLGITEMTEMPLATEEX_SZCLASS helpID=\helpID, exStyle=\exStyle, style=\style, x=\x, y=\y, cx=\cx, cy=\cy, id=\id, windowClass="MSCTLS_PROGRESS32", title=\title, extraCount=\extraCount
+.macro	DLGITEMTEMPLATEEX_PROGRESSBAR helpID=0, exStyle=0, style=0, x=0, y=0, cx=0, cy=0, id=0, title="\0", extraCount=0
+DLGITEMTEMPLATEEX_SZCLASS helpID=\helpID, exStyle=\exStyle, style=\style, x=\x, y=\y, cx=\cx, cy=\cy, id=\id, windowClass="M\0S\0C\0T\0L\0S\0_\0P\0R\0O\0G\0R\0E\0S\0S\0\x33\0\x32\0\0", title=\title, extraCount=\extraCount
+                                                                                                            /*windowClass="MSCTLS_PROGRESS32"*/
 .endm
 
-.macro	DLGITEMTEMPLATEEX_LISTVIEW helpID=0, exStyle=0, style=0, x=0, y=0, cx=0, cy=0, id=0, title="", extraCount=0
-DLGITEMTEMPLATEEX_SZCLASS helpID=\helpID, exStyle=\exStyle, style=\style, x=\x, y=\y, cx=\cx, cy=\cy, id=\id, windowClass="SYSLISTVIEW32", title=\title, extraCount=\extraCount
+.macro	DLGITEMTEMPLATEEX_LISTVIEW helpID=0, exStyle=0, style=0, x=0, y=0, cx=0, cy=0, id=0, title="\0", extraCount=0
+DLGITEMTEMPLATEEX_SZCLASS helpID=\helpID, exStyle=\exStyle, style=\style, x=\x, y=\y, cx=\cx, cy=\cy, id=\id, windowClass="S\0Y\0S\0L\0I\0S\0T\0V\0I\0E\0W\0\x33\0\x32\0\0", title=\title, extraCount=\extraCount
+                                                                                                            /*windowClass="SYSLISTVIEW32"*/
 .endm
 
 .section .rsrc
@@ -158,7 +153,8 @@ rsrc_dialog_content:
 
 .align 4, 0
 rsrc_dialog_data:
-	DLGTEMPLATEEX_WITH_FONT style=(DS_FIXEDSYS|DS_SETFONT|DS_CONTROL|WS_CHILD), cDlgItems=6, x=0, y=0, cx=300, cy=140, pointsize=8, charset=1, typeface="MS Shell Dlg"
+	DLGTEMPLATEEX_WITH_FONT style=(DS_FIXEDSYS|DS_SETFONT|DS_CONTROL|WS_CHILD), cDlgItems=6, x=0, y=0, cx=300, cy=140, pointsize=8, charset=1, typeface="M\0S\0 \0S\0h\0e\0l\0l\0 \0D\0l\0g\0\0"
+	                                                                                                                                         /*typeface="MS Shell Dlg"*/
 rsrc_dialog_items:
 	DLGITEMTEMPLATEEX style=(WS_VISIBLE|WS_CHILD|WS_TABSTOP), x=1, y=26, cx=60, cy=14, id=IDC_SHOWDETAILS, windowClass=WC_BUTTON
 	DLGITEMTEMPLATEEX_PROGRESSBAR style=(WS_VISIBLE|WS_CHILD|WS_BORDER), x=0, y=10, cx=300, cy=11, id=IDC_PROGRESS

Reply via email to