开发者

GetVolumePathName() failed with ERROR 158: ERROR_NOT_LOCKED

GetVo开发者_开发技巧lumePathName() API failed and GetLastError() returned ERROR 158: ERROR_NOT_LOCKED.

What is the reason for this error and how to overcome it?


Can you post some example code how you call that method? Your call should look like following:

_TCHAR Buffer[MAX_PATH + 1] = {0};
if (GetVolumePathName(TEXT("C:\\Windows"), Buffer, MAX_PATH)) {
    // Buffer should return C:\
    // GetLastError() is undefined here
} else {
    // returns GetLatError();
}

However you should keep in mind, that GetLastError() is undefined if GetVolumePathName() call was successful. May be this coould have caused that error code?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜