doc: update doc for RandNumberOfLength and GetExeOrDllVersion

This commit is contained in:
dudaodong committed 2024-10-18 16:38:39 +08:00
1 parent ed93aae970
commit 0a2cc9c928
10 files changed
+86 -24

No files matched your search

+4 -2
View File
@@ -25,8 +25,9 @@ type tagVS_FIXEDFILEINFO struct {
FileDateLS uint32
}
// GetExeDllVersion 获取exe或dll文件的版本信息
func GetExeDllVersion(filePath string) (string, error) {
// GetExeOrDllVersion get the version of exe or dll file on windows.
// Play: todo
func GetExeOrDllVersion(filePath string) (string, error) {
// 加载系统dll
versionDLL := syscall.NewLazyDLL("version.dll")
getFileVersionInfoSize := versionDLL.NewProc("GetFileVersionInfoSizeW")
@@ -77,5 +78,6 @@ func GetExeDllVersion(filePath string) (string, error) {
minor := fixedInfo.FileVersionMS & 0xFFFF
build := fixedInfo.FileVersionLS >> 16
revision := fixedInfo.FileVersionLS & 0xFFFF
return fmt.Sprintf("%d.%d.%d.%d", major, minor, build, revision), nil
}