Skip to content

Commit e5ddd21

Browse files
committed
2.36.26
1 parent 3b1bb8e commit e5ddd21

File tree

7 files changed

+138
-2
lines changed

7 files changed

+138
-2
lines changed

bin/asmc.exe

1 KB
Binary file not shown.

bin/asmc64.exe

0 Bytes
Binary file not shown.

doc/command/option-pe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Option -pe will make Asmc create a binary in Windows PE format.
1515

1616
You can use the [comment](../directive/dot-pragma.md) pragma to specify some linker options.
1717

18-
Valid options are [/BASE](../tools/linkw/base.md), [/ENTRY](../tools/linkw/entry.md), [/FIXED](../tools/linkw/fixed.md), [/LARGEADDRESSAWARE](../tools/linkw/largeaddressaware.md), [/SUBSYSTEM](../tools/linkw/subsystem.md), and [/DLL](../tools/linkw/dll.md).
18+
Valid options are [/BASE](../tools/linkw/base.md), [/ENTRY](../tools/linkw/entry.md), [/FIXED](../tools/linkw/fixed.md), [/LARGEADDRESSAWARE](../tools/linkw/largeaddressaware.md), [/MANIFESTDEPENDENCY](../tools/linkw/manifestdependency.md), [/SUBSYSTEM](../tools/linkw/subsystem.md), and [/DLL](../tools/linkw/dll.md).
1919

2020
#### See Also
2121

source/asmc/inc/version.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ define ASMC_VERSION 236
55

66
define ASMC_MAJOR_VER 2
77
define ASMC_MINOR_VER 36
8-
define ASMC_SUBMINOR_VER 25
8+
define ASMC_SUBMINOR_VER 26
99

1010
endif

source/asmc/src/bin.asm

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ include expreval.inc
2424
include pespec.inc
2525
include qfloat.inc
2626

27+
define ADD_MANIFESTFILE ; Add .pragma comment(linker, "/manifestdependency: ..."
28+
2729
define RAWSIZE_ROUND 1 ;; SectionHeader.SizeOfRawData is multiple FileAlign. Required by MS COFF spec
2830
define IMGSIZE_ROUND 1 ;; OptionalHeader.SizeOfImage is multiple ObjectAlign. Required by MS COFF spec
2931

@@ -1542,6 +1544,60 @@ endif
15421544
assume rbx:nothing
15431545
assume rsi:nothing
15441546

1547+
ifdef ADD_MANIFESTFILE ; v2.36.26 - add manifest file
1548+
1549+
AddManifestdependency proc __ccall uses rsi rdi rbx dependency:string_t
1550+
1551+
.new cp:string_t
1552+
.new fp:LPFILE
1553+
.new file[256]:char_t
1554+
1555+
ldr rbx,dependency
1556+
add rbx,16
1557+
1558+
.if tstrrchr( tstrcpy( &file, GetFNamePart( MODULE.curr_fname[ASM*string_t] ) ), '.' )
1559+
mov byte ptr [rax],0
1560+
.endif
1561+
1562+
.if ( fopen( tstrcat( &file, ".exe.manifest" ), "w" ) != NULL )
1563+
1564+
mov fp,rax
1565+
mov cp,tstrrchr( rbx, '"' )
1566+
.if ( rax )
1567+
mov byte ptr [rax],0
1568+
.endif
1569+
1570+
tfprintf( fp,
1571+
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n"
1572+
"<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>\n"
1573+
" <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n"
1574+
" <security>\n"
1575+
" <requestedPrivileges>\n"
1576+
" <requestedExecutionLevel level='asInvoker' uiAccess='false' />\n"
1577+
" </requestedPrivileges>\n"
1578+
" </security>\n"
1579+
" </trustInfo>\n"
1580+
" <dependency>\n"
1581+
" <dependentAssembly>\n"
1582+
" <assemblyIdentity %s />\n"
1583+
" </dependentAssembly>\n"
1584+
" </dependency>\n"
1585+
"</assembly>\n", rbx )
1586+
1587+
mov rax,cp
1588+
.if ( rax )
1589+
1590+
mov byte ptr [rax],'"'
1591+
lea rbx,[rax+1]
1592+
.endif
1593+
fclose(fp)
1594+
.endif
1595+
mov rax,rbx
1596+
ret
1597+
1598+
AddManifestdependency endp
1599+
endif
1600+
15451601
pe_scan_linker_directives proc __ccall uses rsi rdi rbx pe:ptr, cmd:string_t, size:int_t
15461602

15471603
.new num[4]:dword
@@ -1660,6 +1716,13 @@ pe_scan_linker_directives proc __ccall uses rsi rdi rbx pe:ptr, cmd:string_t, si
16601716
.endif
16611717
.endif
16621718
.endc
1719+
ifdef ADD_MANIFESTFILE
1720+
.case 'inam'
1721+
sub AddManifestdependency(rsi),rsi
1722+
sub size,eax
1723+
add rsi,rax
1724+
.endc
1725+
endif
16631726
.default
16641727
and eax,0x00FFFFFF
16651728
.if eax == 'lld'
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
; TASKDIALOG.ASM--
2+
;
3+
; https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-taskdialogindirect
4+
;
5+
; v2.36.26 - added manifest file for -pe switch
6+
;
7+
; The imported function TaskDialogIndirect (and TaskDialog) from Comctl32.lib needs to
8+
; be added manually to the 64-bit library (lib/x64/def/Comctl32.def) if LINK[W] used.
9+
;
10+
11+
include windows.inc
12+
include commctrl.inc
13+
include tchar.inc
14+
15+
.pragma comment(linker,
16+
"/manifestdependency:\""
17+
"type='win32' "
18+
"name='Microsoft.Windows.Common-Controls' "
19+
"version='6.0.0.0' "
20+
"processorArchitecture='*' "
21+
"publicKeyToken='6595b64144ccf1df' "
22+
"language='*'"
23+
"\""
24+
)
25+
26+
.code
27+
28+
_tWinMain proc WINAPI hInstance:HINSTANCE, hPrevInstance:HINSTANCE, lpCmdLine:LPTSTR, nShowCmd:SINT
29+
30+
31+
.new nButtonPressed:int_t = 0
32+
.new config:TASKDIALOGCONFIG = {0}
33+
.new buttons:TASKDIALOG_BUTTON = { IDOK, L"Change password" }
34+
35+
mov config.cbSize, sizeof(config)
36+
mov config.hInstance, hInstance
37+
mov config.dwCommonButtons, TDCBF_CANCEL_BUTTON
38+
mov config.pszMainIcon, TD_WARNING_ICON
39+
mov config.pszMainInstruction, &@CStr(L"Change Password")
40+
mov config.pszContent, &@CStr(L"Remember your changed password.")
41+
mov config.pButtons, &buttons
42+
mov config.cButtons, ARRAYSIZE(buttons)
43+
44+
TaskDialogIndirect(&config, &nButtonPressed, NULL, NULL)
45+
.switch (nButtonPressed)
46+
.case IDOK
47+
.endc ; the user pressed button 0 (change password).
48+
.case IDCANCEL
49+
.endc ; user canceled the dialog
50+
.default
51+
.endc ; should never happen
52+
.endsw
53+
.return( 0 )
54+
55+
_tWinMain endp
56+
57+
end _tstart
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Makefile for TaskDialog
2+
# Thu Apr 10 2025
3+
4+
flags = -peg -ws
5+
6+
TaskDialog:
7+
asmc64 $(flags) $@.asm
8+
$@
9+
@pause
10+
11+
clean:
12+
del TaskDialog.exe
13+
del TaskDialog.obj
14+
15+
vs:
16+
project -p -w -u TaskDialog

0 commit comments

Comments
 (0)