diff options
Diffstat (limited to 'elevate/shellexecute.go')
-rw-r--r-- | elevate/shellexecute.go | 6 |
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) |