Win2k Restricted user mode problem

  • Thread starter Thread starter rashmipandit
  • Start date Start date
R

rashmipandit

Hi Techies,

I have a Peculiar problem with Windows 2000 Restricted user mode.

I am storing a Compressed video file in CD in ISO format and i have a
Player which decodes the compressed video and plays.

If i run the player in WinXP restricted user mode, it works fine
without any problem, but when it comes to Win 2k restricted user mode
the player is unable to read the CD and fails to play the video.

I am wondering why Readfile Should fail in Win 2k Restricted user mode
which works very well in WinXP restricted user mode.

I need ur expert comments

Thanks in Advance
 
Hi,

I have one more Question here that,The MSDN documentation states that,
inorder to Send an IOCTL code u should be a supervisor but i noticed
different behaviar with Win2k and WinXP.
1. In WinXP, i logged in as Restricted user and Open the CDROM using
Createfile and Call IOCTL disk_Drive_get_Geometry and it succeeds and
then i can also Call Readfile to Read the CD Sectors. The code is As
follows.

HANDLE hDevice; // handle to the drive to be examined
BOOL bResult; // results flag
DWORD junk;
DISK_GEOMETRY pdg;
char *m_hPhysicalDevice= "\\\\.\\D:";
// discard results
DWORD cb;

DWORD bRead;
// CString x;
hDevice = CreateFile(m_hPhysicalDevice, // PhysicalDrive, //
drive to open
GENERIC_READ, // no access to the
drive
FILE_SHARE_READ | // share mode
FILE_SHARE_WRITE,
NULL, // default security attributes
OPEN_EXISTING, // disposition
0, // file attributes
NULL); // do not copy file attributes

if (hDevice == INVALID_HANDLE_VALUE) // cannot open the drive
{

printf("Unable to Open the CD Drive\n");
return (FALSE);
}

bResult = DeviceIoControl(hDevice, // device to be queried
IOCTL_DISK_GET_DRIVE_GEOMETRY, // operation to perform
NULL, 0, // no input buffer
&pdg, sizeof(pdg), // output buffer
&junk, // # bytes returned
(LPOVERLAPPED) NULL); // synchronous I/O

cb=SetFilePointer(hDevice,2048,NULL,FILE_CURRENT);
if(cb)
{
bResult=ReadFile(hDevice,&buf,2048,&bRead,NULL) ;
if(bResult)
printf("Read Successfull\n");
}

This piece of code works fine in WinXP restricted user mode.

But when the Same code comes to Windows 2000 User mode then Only
Createfile Succeds and IOCTL and Readfile Fails.

What is the Alternate work around for this to make sure that i am able
to read CD in Win2k Restricted user mode. Please suggest me

-Rashmi
 
This is probably a seperate thread.

Hi,

I have one more Question here that,The MSDN documentation states that,
inorder to Send an IOCTL code u should be a supervisor but i noticed
different behaviar with Win2k and WinXP.
1. In WinXP, i logged in as Restricted user and Open the CDROM using
Createfile and Call IOCTL disk_Drive_get_Geometry and it succeeds and
then i can also Call Readfile to Read the CD Sectors. The code is As
follows.

HANDLE hDevice; // handle to the drive to be examined
BOOL bResult; // results flag
DWORD junk;
DISK_GEOMETRY pdg;
char *m_hPhysicalDevice= "\\\\.\\D:";
// discard results
DWORD cb;

DWORD bRead;
// CString x;
hDevice = CreateFile(m_hPhysicalDevice, // PhysicalDrive, //
drive to open
GENERIC_READ, // no access to the
drive
FILE_SHARE_READ | // share mode
FILE_SHARE_WRITE,
NULL, // default security attributes
OPEN_EXISTING, // disposition
0, // file attributes
NULL); // do not copy file attributes

if (hDevice == INVALID_HANDLE_VALUE) // cannot open the drive
{

printf("Unable to Open the CD Drive\n");
return (FALSE);
}

bResult = DeviceIoControl(hDevice, // device to be queried
IOCTL_DISK_GET_DRIVE_GEOMETRY, // operation to perform
NULL, 0, // no input buffer
&pdg, sizeof(pdg), // output buffer
&junk, // # bytes returned
(LPOVERLAPPED) NULL); // synchronous I/O

cb=SetFilePointer(hDevice,2048,NULL,FILE_CURRENT);
if(cb)
{
bResult=ReadFile(hDevice,&buf,2048,&bRead,NULL) ;
if(bResult)
printf("Read Successfull\n");
}

This piece of code works fine in WinXP restricted user mode.

But when the Same code comes to Windows 2000 User mode then Only
Createfile Succeds and IOCTL and Readfile Fails.

What is the Alternate work around for this to make sure that i am able
to read CD in Win2k Restricted user mode. Please suggest me

-Rashmi

"Gerry Voras" <[email protected]> wrote in message
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top