This commit is contained in:
dgis 2018-11-23 21:45:13 +00:00
parent 93cb73b0f9
commit 0ad2d47f21
3 changed files with 8 additions and 2 deletions

View file

@ -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
)

View file

@ -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;
}

View file

@ -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,
};