Question : fail to chop 2 GB WMV files

Hi All,
 I am trying to chop a wmv file with the help of window mwdia format APIs. Chopping of file size less than 2 GB is fine but for file have size > 2GB it fails on IWMSyncReader::SetReader API.

OS: WindowsXP (32 bit machine)
Windowmwdiaformat 9.0 SDK
File System : NTFS

Code is like
IWMSyncReader*  m_pReader;
//some useful stuff
HRESULT hr = m_pReader->SerRange();

for file more than 2 GB size hr value is 0xC00D002B whis is an impression of error . GetLast error returns 0.

Can any one suggest me if it the resolution of the problem.

Thanks
Prashant Garg

Code Snippet:
1:
2:
3:
IWMSyncReader*  m_pReader;
//some useful stuff
HRESULT hr = m_pReader->SerRange();

Answer : fail to chop 2 GB WMV files

Hi Michel.
I would like you to thank you for all your intrest in the issue.
Actually I was facing the problem not on a particular system but on all of the system I was trying to chop the media.

m_pReader was opening the file as a stream and SetFilePointer() API that was used to store file pointer
inside the SEEK() method implementation of IStream interface was having the problem.

initially code was like
DWORD dwPos = SetFilePointer( m_hFile, dlibMove.LowPart, NULL, dwMoveMethod );
which was causing puoblem due to NULL in 3rd parameter with > 2GB File size.

After changing the code to
SetFilePointer( m_hFile, dlibMove.LowPart, &dlibMove.HighPart, dwMoveMethod );
things worked.

ref: http://msdn.microsoft.com/en-us/library/aa365541(VS.85).aspx

Thanks
Random Solutions  
 
programming4us programming4us