Bug#919023: Simplification of BOOTCFG_CreateGUID function
Package: win32-loader
Version: 0.9.3
Severity: normal
Tags: patch
The conversion of an UUID value into a string can be achieved by just
using the g (GUID) type of the System plug-in. As a consequence the
Win32 API calls could be eliminated.
-- System Information:
Debian Release: 9.6
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.18.0-0.bpo.3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
win32-loader depends on no packages.
win32-loader recommends no packages.
Versions of packages win32-loader suggests:
pn wine <none>
>From e735da16c5059c680d279a00de8cdf3c0e1bf53e Mon Sep 17 00:00:00 2001
From: Thomas Gaugler <thomas@dadie.net>
Date: Fri, 11 Jan 2019 22:04:52 +0100
Subject: [PATCH] Simplification of BOOTCFG_CreateGUID function
The conversion of an UUID value into a string can be achieved by just using the g (GUID) type of the System plug-in. As a consequence the Win32 API calls could be eliminated.
---
include/bootcfg.nsh | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/include/bootcfg.nsh b/include/bootcfg.nsh
index 59ca3f4..3b087e4 100644
--- a/include/bootcfg.nsh
+++ b/include/bootcfg.nsh
@@ -1868,7 +1868,6 @@ FunctionEnd
Push $0
Push $1
Push $2
- Push $3
; Initialize return value
StrCpy $0 ""
@@ -1876,24 +1875,11 @@ FunctionEnd
${If} $2 != 0
System::Call "rpcrt4::UuidCreate(p r2) i.r1"
${If} $1 == 0
- ; Create reference pointer
- System::Call "*(&t0) p.r3"
- ${If} $3 != 0
- System::Call "rpcrt4::UuidToString(p r2, pr3r3) i.r1"
- ${If} $1 == 0
- ; Extract string from reference pointer
- System::Call "*$3(p .r0)"
- System::Call "*$0(&t${NSIS_MAX_STRLEN} .r0)"
- StrCpy $0 "{$0}"
- System::Call "rpcrt4::RpcStringFree(pr3)"
- ${EndIf}
- System::Free $3
- ${EndIf}
+ System::Call "*$2(g .r0)"
${EndIf}
System::Free $2
${EndIf}
- Pop $3
Pop $2
Pop $1
Exch $0
--
2.20.1
Reply to: