GetModuleFileNameEx is a wrapper for the same WIN32 API function https://docs.microsoft.com/fr-fr/windows/win32/api/psapi/nf-psapi-getmodulefilenameexa?redirectedfrom=MSDN
(hProcess windows.Handle, hModule syscall.Handle, nSize uintptr)
| 112 | // GetModuleFileNameEx is a wrapper for the same WIN32 API function |
| 113 | // https://docs.microsoft.com/fr-fr/windows/win32/api/psapi/nf-psapi-getmodulefilenameexa?redirectedfrom=MSDN |
| 114 | func GetModuleFileNameEx(hProcess windows.Handle, hModule syscall.Handle, nSize uintptr) (data []byte, err error) { |
| 115 | data = make([]byte, nSize) |
| 116 | ret, _, _ := syscall.Syscall6(procGetModuleFileNameEx.Addr(), 4, uintptr(hProcess), uintptr(hModule), uintptr(unsafe.Pointer(&data[0])), uintptr(nSize), 0, 0) |
| 117 | if ret == 0 { |
| 118 | return nil, err |
| 119 | } |
| 120 | |
| 121 | return data, nil |
| 122 | } |
| 123 | |
| 124 | // GetModuleInformation is a wrapper for the same WIN32 API function |
| 125 | // https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getmoduleinformation |