Problem with updating Mpqlib menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    hamburger12's Avatar Contributor CoreCoins Purchaser
    Reputation
    87
    Join Date
    Jan 2010
    Posts
    297
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with updating Mpqlib

    Hello! I'm currently updating MPQLib for MoP. I got it working with the newest MPQ files excepted the files which have the flag "Incremental Patch".


    Here is the part which fails:

    Code:
    System::Void MpqLib::Mpq::CFileStream::Open()
    {
    	System::Int32 BytesRead = 0;
    	pin_ptr<HANDLE> HandlePointer = &_Handle;
    	CStringHandle FileNameHandle(_FileName);
    
    	if(_Archive == nullptr) throw gcnew System::InvalidOperationException("The file stream has no associated archive!");
    	if(_Archive->IsDisposed) throw gcnew System::ObjectDisposedException(nullptr, "The archive of the file stream has been disposed!");
    	if((_Archive->Handle == NULL) || (_Archive->Handle == INVALID_HANDLE_VALUE)) throw gcnew System::InvalidOperationException("The archive of the file stream has been closed!");
    
    	if(!_Archive->FileExists(_FileName)) throw gcnew System::IO::FileNotFoundException("Could not find \"" + _FileName + "\"!", _FileName);
    
    
    	if(!SFileOpenFileEx(_Archive->Handle, FileNameHandle.Value, 1, HandlePointer) && !SFileOpenFileEx(_Archive->Handle, FileNameHandle.Value, 0, HandlePointer)) throw gcnew System::IO::IOException("Unable to open \"" + _FileName + "\"!");
    	
    
    	DWORD length;
    	SFileGetFileInfo(_Handle, SFILE_INFO_FILE_SIZE, &length, 4, NULL);
    	_Length = length;
    	if(_Length < 0) _Length = 0;
    
    	_Cache->resize(static_cast<System::UInt32>(_Length));
    
    	if(!SFileReadFile(_Handle, &((*_Cache)[0]), static_cast<DWORD>(_Length), reinterpret_cast<LPDWORD>(&BytesRead), NULL)) throw gcnew System::IO::IOException("Read operation failed with error: " + GetLastError());
    	if(_Length != static_cast<System::Int64>(BytesRead)) throw gcnew System::IO::IOException("Read failed, expected " + _Length + " bytes, read " + BytesRead + " bytes!");
    
    	_Position = 0;
    }
    At the end it fails with error code 38 which is end of file..

    Do you got an idea what could be wrong with it?


    *Found Solution o.O* Please close thx!
    Last edited by hamburger12; 09-24-2012 at 05:15 PM.

    Problem with updating Mpqlib
  2. #2
    Shadowhunter12's Avatar Member
    Reputation
    1
    Join Date
    Sep 2012
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hamburger12 View Post
    Hello! I'm currently updating MPQLib for MoP. I got it working with the newest MPQ files excepted the files which have the flag "Incremental Patch".


    Here is the part which fails:

    Code:
    System::Void MpqLib::Mpq::CFileStream::Open()
    {
    	System::Int32 BytesRead = 0;
    	pin_ptr<HANDLE> HandlePointer = &_Handle;
    	CStringHandle FileNameHandle(_FileName);
    
    	if(_Archive == nullptr) throw gcnew System::InvalidOperationException("The file stream has no associated archive!");
    	if(_Archive->IsDisposed) throw gcnew System::ObjectDisposedException(nullptr, "The archive of the file stream has been disposed!");
    	if((_Archive->Handle == NULL) || (_Archive->Handle == INVALID_HANDLE_VALUE)) throw gcnew System::InvalidOperationException("The archive of the file stream has been closed!");
    
    	if(!_Archive->FileExists(_FileName)) throw gcnew System::IO::FileNotFoundException("Could not find \"" + _FileName + "\"!", _FileName);
    
    
    	if(!SFileOpenFileEx(_Archive->Handle, FileNameHandle.Value, 1, HandlePointer) && !SFileOpenFileEx(_Archive->Handle, FileNameHandle.Value, 0, HandlePointer)) throw gcnew System::IO::IOException("Unable to open \"" + _FileName + "\"!");
    	
    
    	DWORD length;
    	SFileGetFileInfo(_Handle, SFILE_INFO_FILE_SIZE, &length, 4, NULL);
    	_Length = length;
    	if(_Length < 0) _Length = 0;
    
    	_Cache->resize(static_cast<System::UInt32>(_Length));
    
    	if(!SFileReadFile(_Handle, &((*_Cache)[0]), static_cast<DWORD>(_Length), reinterpret_cast<LPDWORD>(&BytesRead), NULL)) throw gcnew System::IO::IOException("Read operation failed with error: " + GetLastError());
    	if(_Length != static_cast<System::Int64>(BytesRead)) throw gcnew System::IO::IOException("Read failed, expected " + _Length + " bytes, read " + BytesRead + " bytes!");
    
    	_Position = 0;
    }
    At the end it fails with error code 38 which is end of file..

    Do you got an idea what could be wrong with it?


    *Found Solution o.O* Please close thx!

    Hey there, I am having the same issue with MpqLib for MoP with the incremental patch flag. Can you please post what you did to resolve it? Also, do you know of an updated MpqLib solution?

    Thanks!

    -Shadow

  3. #3
    Shadowhunter12's Avatar Member
    Reputation
    1
    Join Date
    Sep 2012
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone have any insight into the issue with MpqLib please?

    Thank you everyone!

    -Shadow

Similar Threads

  1. Problem with MadCow(updated mine)
    By papaosiopao in forum Diablo 3 Emulator Servers
    Replies: 0
    Last Post: 06-29-2012, 11:52 AM
  2. Problem with updating position
    By flo8464 in forum WoW Memory Editing
    Replies: 21
    Last Post: 05-08-2009, 11:50 AM
  3. [Question] Problems with the new WoW update.
    By Aradroth in forum WoW ME Questions and Requests
    Replies: 6
    Last Post: 01-23-2008, 09:40 PM
  4. Problem with CE.
    By Eldretch in forum World of Warcraft General
    Replies: 1
    Last Post: 08-08-2006, 06:49 PM
  5. I have problem with BHW 3.0
    By sunrize1 in forum World of Warcraft General
    Replies: 1
    Last Post: 07-17-2006, 08:49 AM
All times are GMT -5. The time now is 10:13 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search