CreateFile getlasterror 返回5

场景:CreateFile GetLastError 返回5怎么解决

CreateFile GetLastError 返回5如何解决?
int ReadSector( int drive , int SectorNo , PBYTE pbRBuf , int SectorNumber ) 

HANDLE hDevice; 
TCHAR szDevicename[64]; 
DISK_GEOMETRY Geometry; 
BOOL bRet; 
DWORD bytes,bread,count; 

wsprintf(szDevicename,_T("\\\\.\\PHYSICALDRIVE%c"), '0'+drive ); 

OutputDebugString(szDevicename);

hDevice = CreateFile( szDevicename, 
GENERIC_READ|GENERIC_WRITE, 
FILE_SHARE_READ|FILE_SHARE_WRITE, 
NULL, 
OPEN_EXISTING, 
0, 
NULL 
); 
if (hDevice == INVALID_HANDLE_VALUE) 

MessageBox(NULL,_T("Open Device Error!"),NULL,MB_OK); 
return 0; 

DeviceIoControl(hDevice,FSCTL_LOCK_VOLUME, NULL,0,NULL,0,&count,NULL); 
DeviceIoControl(hDevice,IOCTL_DISK_GET_DRIVE_GEOMETRY,NULL,0,&Geometry,sizeof(DISK_GEOMETRY),&count,(LPOVERLAPPED)NULL); 

bytes = 512*SectorNumber ; 
DWORD dwPos = SetFilePointer(hDevice, SectorNo * 512 , NULL, FILE_BEGIN );  
bRet = ReadFile(hDevice, pbRBuf , bytes, &bread, NULL); 
if (bRet == FALSE || bread < 512) 

MessageBox(NULL,_T("Read device error!"),NULL,MB_OK); 
return 0; 

DeviceIoControl(hDevice,FSCTL_UNLOCK_VOLUME, NULL,0,NULL,0,&count,NULL); 
CloseHandle(hDevice); 

//MessageBox(NULL,_T("读MBR OK"),NULL,MB_OK); 
return 1 ;
}

我的机子上CreateFile的时候正常,在客户机器上却INVALID_HANDLE_VALUE,弹出对话框.是权限不够吗?

------解决方案--------------------
把你的环境和客户机的环境说清楚!
不然让别人来猜?