GetVolumeNameForVolumeMountPoint returns false

Posted by new on Stack Overflow See other posts from Stack Overflow or by new
Published on 2010-06-09T10:18:22Z Indexed on 2010/06/09 10:22 UTC
Read the original article Hit count: 172

Filed under:
|
|

Hi..

To get the volume GUID i tried the code like below

int len = wcslen( pDetData->DevicePath);

pDetData->DevicePath[len] = '\';

pDetData->DevicePath[len+1] = 0;

define BUFFER_SIZE MAX_PATH

WCHAR volume[BUFFER_SIZE];

BOOL bFlag;

bFlag = GetVolumeNameForVolumeMountPoint( pDetData->DevicePath, volume, BUFFER_SIZE );

int loginErrCode = GetLastError();

printf("loginErrCode: %d\n", loginErrCode);

printf("BFLAG: %d\n", bFlag);

the GetLastError() also prints it as 1 . it means ERROR_INVALID_FUNCTION

the bFlag always returns zero it means false.

what is the problem in my code...

please help me up to get the above function work right

© Stack Overflow or respective owner

Related posts about c++

Related posts about win32