Browse Source

Merge pull request #220 from FooSoft/allow_readonly_mpq_archive_access

Allow readonly mpq archive access
pull/221/head
qndel 7 years ago committed by GitHub
parent
commit
884fb45193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      Source/init.cpp
  2. 2
      SourceX/DiabloUI/diabloui.cpp

18
Source/init.cpp

@ -233,7 +233,7 @@ void init_archives()
#ifdef COPYPROT
while (1) {
#endif
diabdat_mpq = init_test_access(diabdat_mpq_path, "\\diabdat.mpq", "DiabloCD", 1000, FS_CD);
diabdat_mpq = init_test_access(diabdat_mpq_path, "\\diabdat.mpq", "DiabloCD", MPQ_FLAG_READ_ONLY, FS_CD);
#ifdef COPYPROT
if (diabdat_mpq)
break;
@ -245,7 +245,7 @@ void init_archives()
if (!WOpenFile("ui_art\\title.pcx", &fh, TRUE))
FileErrDlg("Main program archive: diabdat.mpq");
WCloseFile(fh);
patch_rt_mpq = init_test_access(patch_rt_mpq_path, "\\patch_rt.mpq", "DiabloInstall", 2000, FS_PC);
patch_rt_mpq = init_test_access(patch_rt_mpq_path, "\\patch_rt.mpq", "DiabloInstall", MPQ_FLAG_READ_ONLY, FS_PC);
}
HANDLE init_test_access(char *mpq_path, char *mpq_name, char *reg_loc, int flags, int fs)
@ -270,18 +270,18 @@ HANDLE init_test_access(char *mpq_path, char *mpq_name, char *reg_loc, int flags
strcpy(mpq_path, Buffer);
strcat(mpq_path, mpq_name);
#ifdef COPYPROT
if (SFileOpenArchive(mpq_path, flags, fs, &archive))
if (SFileOpenArchive(mpq_path, 0, flags, &archive))
#else
if (SFileOpenArchive(mpq_path, flags, FS_PC, &archive))
if (SFileOpenArchive(mpq_path, 0, flags, &archive))
#endif
return archive;
if (strcmp(Filename, Buffer)) {
strcpy(mpq_path, Filename);
strcat(mpq_path, mpq_name);
#ifdef COPYPROT
if (SFileOpenArchive(mpq_path, flags, fs, &archive))
if (SFileOpenArchive(mpq_path, 0, flags, &archive))
#else
if (SFileOpenArchive(mpq_path, flags, FS_PC, &archive))
if (SFileOpenArchive(mpq_path, 0, flags, &archive))
#endif
return archive;
}
@ -292,9 +292,9 @@ HANDLE init_test_access(char *mpq_path, char *mpq_name, char *reg_loc, int flags
strcpy(mpq_path, archive_path);
strcat(mpq_path, mpq_name);
#ifdef COPYPROT
if (SFileOpenArchive(mpq_path, flags, fs, &archive))
if (SFileOpenArchive(mpq_path, 0, flags, &archive))
#else
if (SFileOpenArchive(mpq_path, flags, FS_PC, &archive))
if (SFileOpenArchive(mpq_path, 0, flags, &archive))
#endif
return archive;
}
@ -341,7 +341,7 @@ BOOL init_read_test_file(char *pszPath, char *pszArchive, int flags, HANDLE *phA
if (GetDriveType(pszRoot) == DRIVE_CDROM) {
strcpy(pszPath, pszRoot);
strcat(pszPath, pszArchive);
if (SFileOpenArchive(pszPath, flags, 1, phArchive)) {
if (SFileOpenArchive(pszPath, 0, flags, phArchive)) {
return TRUE;
}
}

2
SourceX/DiabloUI/diabloui.cpp

@ -53,7 +53,7 @@ char *errorMessages[] = {
"Diablo was unable to find the file \"dsound.dll\", which is a component of Microsoft DirectX.\nPlease run the program \"SETUP.EXE\" on the Diablo CD-ROM and install Microsoft DirectX.\n\nIf you continue to have problems with DirectX, please contact Microsoft's Technical Support at:\n\n USA telephone: 1-800-426-9400\n International telephone: 206-882-8080\n http://www.microsoft.com\n\n\nThe error encountered while trying to initialize DirectX was:\n\n %s",
"Diablo requires at least 10 megabytes of free disk space to run properly.\nThe disk:\n\n%s\n\nhas less than 10 megabytes of free space left.\n\nPlease free some space on your drive and run Diablo again.",
"Diablo was unable to switch video modes.\nThis is a common problem for computers with more than one video card.\nTo correct this problem, please set your video resolution to 640 x 480 and try running Diablo again.\n\nFor Windows 95 and Windows NT\n Select \"Settings - Control Panel\" from the \"Start\" menu\n Run the \"Display\" control panel applet\n Select the \"Settings\" tab\n Set the \"Desktop Area\" to \"640 x 480 pixels\"\n\n\nThe error encountered while trying to switch video modes was:\n\n %s",
"Diablo cannot read a required data file.\nYour diabdat.mpq may not be in the Devilution folder or it's read only.\nPlease ensure that the filename is in all lower case and try again.\n %s",
"Diablo cannot read a required data file.\nYour diabdat.mpq may not be in the Devilution folder.\nPlease ensure that the filename is in all lower case and try again.\n %s",
"In order to install, play or patch Diablo using the Windows 2000 operating system,\nyou will need to log in as either an Administrator or as a Power User.\n\nUsers, also known as Restricted Users, do not have sufficient access to install or play the game properly.\n\nIf you have further questions regarding User Rights in Windows 2000, please refer to your Windows 2000 documentation or contact your system administrator.",
"Diablo is being run from:\n\n %s\n\n\nDiablo or the current user does not seem to have write privilages in this directory. Contact your system administrator.\n\nNote that Windows 2000 Restricted Users can not write to the Windows or Program Files directory hierarchies.",
};

Loading…
Cancel
Save