diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 23f8b1b..99fce92 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -55,6 +55,7 @@ add_library( # Sets the name of the library. src/main/cpp/win32-layer.c src/main/cpp/android-layer.c + src/main/cpp/android-display.c # display.c rewrite src/main/cpp/android-emu48.c # Emu48.c rewrite src/main/cpp/emu48-jni.c ) diff --git a/app/src/main/cpp/win32-layer.c b/app/src/main/cpp/win32-layer.c index 2ca0c81..4138361 100644 --- a/app/src/main/cpp/win32-layer.c +++ b/app/src/main/cpp/win32-layer.c @@ -98,8 +98,9 @@ DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveH } BOOL SetEndOfFile(HANDLE hFile) { - //TODO - return FALSE; + off_t currentPosition = lseek(hFile->fileDescriptor, 0, SEEK_CUR); + int truncateResult = ftruncate(hFile->fileDescriptor, currentPosition); + return truncateResult == 0; } DWORD GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh) { @@ -109,6 +110,9 @@ DWORD GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh) { return fileLength; } +//** https://www.ibm.com/developerworks/systems/library/es-MigratingWin32toLinux.html +//https://www.ibm.com/developerworks/systems/library/es-win32linux.html +//https://www.ibm.com/developerworks/systems/library/es-win32linux-sem.html HANDLE CreateFileMapping(HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName) { return NULL; } diff --git a/app/src/main/cpp/win32-layer.h b/app/src/main/cpp/win32-layer.h index ea13a31..bbed556 100644 --- a/app/src/main/cpp/win32-layer.h +++ b/app/src/main/cpp/win32-layer.h @@ -52,6 +52,7 @@ typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; enum HANDLE_TYPE { HANDLE_TYPE_FILE = 1, + HANDLE_TYPE_FILE_MAPPING, HANDLE_TYPE_EVENT, HANDLE_TYPE_THREAD, };