🎨 改进 Windows 端第三方同步盘检测 Fix https://github.com/siyuan-note/siyuan/issues/7777

This commit is contained in:
Liang Ding 2023-03-27 15:39:29 +08:00
parent acdd12475e
commit f3b36675cf
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 24 additions and 4 deletions

View file

@ -323,9 +323,27 @@ func existAvailabilityStatus(workspaceAbsPath string) bool {
return false
}
defer shell.Release()
folderObj := oleutil.MustCallMethod(shell, "NameSpace", dir).ToIDispatch()
fileObj := oleutil.MustCallMethod(folderObj, "ParseName", file).ToIDispatch()
value := oleutil.MustCallMethod(folderObj, "GetDetailsOf", fileObj, 303)
result, err := oleutil.CallMethod(shell, "NameSpace", dir)
if nil != err {
logging.LogWarnf("call shell [NameSpace] failed: %s", err)
return false
}
folderObj := result.ToIDispatch()
result = oleutil.MustCallMethod(folderObj, "ParseName", file)
if nil != err {
logging.LogWarnf("call shell [ParseName] failed: %s", err)
return false
}
fileObj := result.ToIDispatch()
result, err = oleutil.CallMethod(folderObj, "GetDetailsOf", fileObj, 303)
if nil != err {
logging.LogWarnf("call shell [GetDetailsOf] failed: %s", err)
return false
}
value := result
if nil == value {
return false
}