diff --git a/app/src/main/cpp/emu48-jni.c b/app/src/main/cpp/emu48-jni.c index a95224a..ca51d2b 100644 --- a/app/src/main/cpp/emu48-jni.c +++ b/app/src/main/cpp/emu48-jni.c @@ -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); diff --git a/app/src/main/cpp/win32-layer.c b/app/src/main/cpp/win32-layer.c index da2d706..f0a2e2c 100644 --- a/app/src/main/cpp/win32-layer.c +++ b/app/src/main/cpp/win32-layer.c @@ -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;