aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/elevate/shellexecute.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-08-26 13:04:00 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2019-08-26 14:48:41 -0600
commit45a74f31931015fbb567f80447732684576b315a (patch)
tree84a72782b37f8e3db3675d981846299a1855bed8 /elevate/shellexecute.go
parentui: enable priority boost (diff)
downloadwireguard-windows-45a74f31931015fbb567f80447732684576b315a.tar.xz
wireguard-windows-45a74f31931015fbb567f80447732684576b315a.zip
elevate: use upstream windows directory function
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--elevate/shellexecute.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/elevate/shellexecute.go b/elevate/shellexecute.go
index c4cd04da..6933c8f5 100644
--- a/elevate/shellexecute.go
+++ b/elevate/shellexecute.go
@@ -93,12 +93,12 @@ func ShellExecute(program string, arguments string, directory string, show int32
if err != nil {
return
}
- var windowsDirectory [windows.MAX_PATH]uint16
- if _, err = getSystemWindowsDirectory(&windowsDirectory[0], windows.MAX_PATH); err != nil {
+ windowsDirectory, err := windows.GetSystemWindowsDirectory()
+ if err != nil {
return
}
originalPath := dataTableEntry.FullDllName.Buffer
- explorerPath := windows.StringToUTF16Ptr(filepath.Join(windows.UTF16ToString(windowsDirectory[:]), "explorer.exe"))
+ explorerPath := windows.StringToUTF16Ptr(filepath.Join(windowsDirectory, "explorer.exe"))
rtlInitUnicodeString(&dataTableEntry.FullDllName, explorerPath)
defer func() {
rtlInitUnicodeString(&dataTableEntry.FullDllName, originalPath)