This commit is contained in:
dgis 2019-02-05 19:15:17 +00:00
parent c2dbcf3931
commit 7cae0ed7fc
2 changed files with 19 additions and 0 deletions

View file

@ -408,6 +408,22 @@ JNIEXPORT jint JNICALL Java_org_emulator_forty_eight_NativeLib_onFileOpen(JNIEnv
_tcscpy(szBufferFilename, stateFilenameUTF8);
chooseCurrentKmlMode = ChooseKmlMode_FILE_OPEN;
//TODO
// TCHAR * fileScheme = _T("raw:");
// TCHAR * urlContentSchemeFound = _tcsstr(szChosenCurrentKml, fileScheme);
// if(urlContentSchemeFound) {
// _tcscpy(szChosenCurrentKml, szChosenCurrentKml + 4 * sizeof(TCHAR));
// _tcscpy(szEmuDirectory, szChosenCurrentKml);
// TCHAR * filename = _tcsrchr(szEmuDirectory, _T('/'));
// if(filename) {
// *filename = _T('\0');
// }
// _tcscpy(szRomDirectory, szEmuDirectory);
// } else {
// _tcscpy(szEmuDirectory, "assets/calculators/");
// _tcscpy(szRomDirectory, "assets/calculators/");
// }
BOOL result = OpenDocument(szBufferFilename);
if (result)
MruAdd(szBufferFilename);

View file

@ -220,6 +220,9 @@ HANDLE CreateFileMapping(HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttrib
handle->handleType = HANDLE_TYPE_FILE_MAPPING_ASSET;
handle->fileAsset = hFile->fileAsset;
}
if(dwMaximumSizeHigh == 0 && dwMaximumSizeLow == 0) {
dwMaximumSizeLow = GetFileSize(hFile, &dwMaximumSizeHigh);
}
handle->fileMappingSize = (dwMaximumSizeHigh << 32) | dwMaximumSizeLow;
handle->fileMappingAddress = NULL;
return handle;