Commit 6b7957f4 authored by Gerald Pfeifer's avatar Gerald Pfeifer Committed by Alexandre Julliard

winedos: Use DWORD instead of long for return values of SetFilePointer.

Adjust type of loop variable in INT21_Ioctl_Char().
parent 7b804106
...@@ -1385,7 +1385,7 @@ static void INT21_SequentialReadFromFCB( CONTEXT86 *context ) ...@@ -1385,7 +1385,7 @@ static void INT21_SequentialReadFromFCB( CONTEXT86 *context )
struct XFCB *xfcb; struct XFCB *xfcb;
HANDLE handle; HANDLE handle;
DWORD record_number; DWORD record_number;
long position; DWORD position;
BYTE *disk_transfer_area; BYTE *disk_transfer_area;
UINT bytes_read; UINT bytes_read;
BYTE AL_result; BYTE AL_result;
...@@ -1405,7 +1405,7 @@ static void INT21_SequentialReadFromFCB( CONTEXT86 *context ) ...@@ -1405,7 +1405,7 @@ static void INT21_SequentialReadFromFCB( CONTEXT86 *context )
record_number = 128 * fcb->current_block_number + fcb->record_within_current_block; record_number = 128 * fcb->current_block_number + fcb->record_within_current_block;
position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0); position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0);
if (position != record_number * fcb->logical_record_size) { if (position != record_number * fcb->logical_record_size) {
TRACE("seek(%d, %d, 0) failed with %ld\n", TRACE("seek(%d, %d, 0) failed with %u\n",
fcb->file_number, record_number * fcb->logical_record_size, position); fcb->file_number, record_number * fcb->logical_record_size, position);
AL_result = 0x01; /* end of file, no data read */ AL_result = 0x01; /* end of file, no data read */
} else { } else {
...@@ -1421,7 +1421,7 @@ static void INT21_SequentialReadFromFCB( CONTEXT86 *context ) ...@@ -1421,7 +1421,7 @@ static void INT21_SequentialReadFromFCB( CONTEXT86 *context )
AL_result = 0x03; /* end of file, partial record read */ AL_result = 0x03; /* end of file, partial record read */
} /* if */ } /* if */
} else { } else {
TRACE("successful read %d bytes from record %d (position %ld) of file %d (handle %p)\n", TRACE("successful read %d bytes from record %d (position %u) of file %d (handle %p)\n",
bytes_read, record_number, position, fcb->file_number, handle); bytes_read, record_number, position, fcb->file_number, handle);
AL_result = 0x00; /* successful */ AL_result = 0x00; /* successful */
} /* if */ } /* if */
...@@ -1465,7 +1465,7 @@ static void INT21_SequentialWriteToFCB( CONTEXT86 *context ) ...@@ -1465,7 +1465,7 @@ static void INT21_SequentialWriteToFCB( CONTEXT86 *context )
struct XFCB *xfcb; struct XFCB *xfcb;
HANDLE handle; HANDLE handle;
DWORD record_number; DWORD record_number;
long position; DWORD position;
BYTE *disk_transfer_area; BYTE *disk_transfer_area;
UINT bytes_written; UINT bytes_written;
BYTE AL_result; BYTE AL_result;
...@@ -1485,7 +1485,7 @@ static void INT21_SequentialWriteToFCB( CONTEXT86 *context ) ...@@ -1485,7 +1485,7 @@ static void INT21_SequentialWriteToFCB( CONTEXT86 *context )
record_number = 128 * fcb->current_block_number + fcb->record_within_current_block; record_number = 128 * fcb->current_block_number + fcb->record_within_current_block;
position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0); position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0);
if (position != record_number * fcb->logical_record_size) { if (position != record_number * fcb->logical_record_size) {
TRACE("seek(%d, %d, 0) failed with %ld\n", TRACE("seek(%d, %d, 0) failed with %u\n",
fcb->file_number, record_number * fcb->logical_record_size, position); fcb->file_number, record_number * fcb->logical_record_size, position);
AL_result = 0x01; /* disk full */ AL_result = 0x01; /* disk full */
} else { } else {
...@@ -1496,7 +1496,7 @@ static void INT21_SequentialWriteToFCB( CONTEXT86 *context ) ...@@ -1496,7 +1496,7 @@ static void INT21_SequentialWriteToFCB( CONTEXT86 *context )
fcb->file_number, disk_transfer_area, fcb->logical_record_size, bytes_written); fcb->file_number, disk_transfer_area, fcb->logical_record_size, bytes_written);
AL_result = 0x01; /* disk full */ AL_result = 0x01; /* disk full */
} else { } else {
TRACE("successful written %d bytes from record %d (position %ld) of file %d (handle %p)\n", TRACE("successful written %d bytes from record %d (position %u) of file %d (handle %p)\n",
bytes_written, record_number, position, fcb->file_number, handle); bytes_written, record_number, position, fcb->file_number, handle);
AL_result = 0x00; /* successful */ AL_result = 0x00; /* successful */
} /* if */ } /* if */
...@@ -1541,7 +1541,7 @@ static void INT21_ReadRandomRecordFromFCB( CONTEXT86 *context ) ...@@ -1541,7 +1541,7 @@ static void INT21_ReadRandomRecordFromFCB( CONTEXT86 *context )
struct XFCB *xfcb; struct XFCB *xfcb;
HANDLE handle; HANDLE handle;
DWORD record_number; DWORD record_number;
long position; DWORD position;
BYTE *disk_transfer_area; BYTE *disk_transfer_area;
UINT bytes_read; UINT bytes_read;
BYTE AL_result; BYTE AL_result;
...@@ -1561,7 +1561,7 @@ static void INT21_ReadRandomRecordFromFCB( CONTEXT86 *context ) ...@@ -1561,7 +1561,7 @@ static void INT21_ReadRandomRecordFromFCB( CONTEXT86 *context )
} else { } else {
position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0); position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0);
if (position != record_number * fcb->logical_record_size) { if (position != record_number * fcb->logical_record_size) {
TRACE("seek(%d, %d, 0) failed with %ld\n", TRACE("seek(%d, %d, 0) failed with %u\n",
fcb->file_number, record_number * fcb->logical_record_size, position); fcb->file_number, record_number * fcb->logical_record_size, position);
AL_result = 0x01; /* end of file, no data read */ AL_result = 0x01; /* end of file, no data read */
} else { } else {
...@@ -1577,7 +1577,7 @@ static void INT21_ReadRandomRecordFromFCB( CONTEXT86 *context ) ...@@ -1577,7 +1577,7 @@ static void INT21_ReadRandomRecordFromFCB( CONTEXT86 *context )
AL_result = 0x03; /* end of file, partial record read */ AL_result = 0x03; /* end of file, partial record read */
} /* if */ } /* if */
} else { } else {
TRACE("successful read %d bytes from record %d (position %ld) of file %d (handle %p)\n", TRACE("successful read %d bytes from record %d (position %u) of file %d (handle %p)\n",
bytes_read, record_number, position, fcb->file_number, handle); bytes_read, record_number, position, fcb->file_number, handle);
AL_result = 0x00; /* successful */ AL_result = 0x00; /* successful */
} /* if */ } /* if */
...@@ -1614,7 +1614,7 @@ static void INT21_WriteRandomRecordToFCB( CONTEXT86 *context ) ...@@ -1614,7 +1614,7 @@ static void INT21_WriteRandomRecordToFCB( CONTEXT86 *context )
struct XFCB *xfcb; struct XFCB *xfcb;
HANDLE handle; HANDLE handle;
DWORD record_number; DWORD record_number;
long position; DWORD position;
BYTE *disk_transfer_area; BYTE *disk_transfer_area;
UINT bytes_written; UINT bytes_written;
BYTE AL_result; BYTE AL_result;
...@@ -1634,7 +1634,7 @@ static void INT21_WriteRandomRecordToFCB( CONTEXT86 *context ) ...@@ -1634,7 +1634,7 @@ static void INT21_WriteRandomRecordToFCB( CONTEXT86 *context )
} else { } else {
position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0); position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0);
if (position != record_number * fcb->logical_record_size) { if (position != record_number * fcb->logical_record_size) {
TRACE("seek(%d, %d, 0) failed with %ld\n", TRACE("seek(%d, %d, 0) failed with %u\n",
fcb->file_number, record_number * fcb->logical_record_size, position); fcb->file_number, record_number * fcb->logical_record_size, position);
AL_result = 0x01; /* disk full */ AL_result = 0x01; /* disk full */
} else { } else {
...@@ -1645,7 +1645,7 @@ static void INT21_WriteRandomRecordToFCB( CONTEXT86 *context ) ...@@ -1645,7 +1645,7 @@ static void INT21_WriteRandomRecordToFCB( CONTEXT86 *context )
fcb->file_number, disk_transfer_area, fcb->logical_record_size, bytes_written); fcb->file_number, disk_transfer_area, fcb->logical_record_size, bytes_written);
AL_result = 0x01; /* disk full */ AL_result = 0x01; /* disk full */
} else { } else {
TRACE("successful written %d bytes from record %d (position %ld) of file %d (handle %p)\n", TRACE("successful written %d bytes from record %d (position %u) of file %d (handle %p)\n",
bytes_written, record_number, position, fcb->file_number, handle); bytes_written, record_number, position, fcb->file_number, handle);
AL_result = 0x00; /* successful */ AL_result = 0x00; /* successful */
} /* if */ } /* if */
...@@ -1689,7 +1689,7 @@ static void INT21_RandomBlockReadFromFCB( CONTEXT86 *context ) ...@@ -1689,7 +1689,7 @@ static void INT21_RandomBlockReadFromFCB( CONTEXT86 *context )
struct XFCB *xfcb; struct XFCB *xfcb;
HANDLE handle; HANDLE handle;
DWORD record_number; DWORD record_number;
long position; DWORD position;
BYTE *disk_transfer_area; BYTE *disk_transfer_area;
UINT records_requested; UINT records_requested;
UINT bytes_requested; UINT bytes_requested;
...@@ -1713,7 +1713,7 @@ static void INT21_RandomBlockReadFromFCB( CONTEXT86 *context ) ...@@ -1713,7 +1713,7 @@ static void INT21_RandomBlockReadFromFCB( CONTEXT86 *context )
} else { } else {
position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0); position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0);
if (position != record_number * fcb->logical_record_size) { if (position != record_number * fcb->logical_record_size) {
TRACE("seek(%d, %d, 0) failed with %ld\n", TRACE("seek(%d, %d, 0) failed with %u\n",
fcb->file_number, record_number * fcb->logical_record_size, position); fcb->file_number, record_number * fcb->logical_record_size, position);
records_read = 0; records_read = 0;
AL_result = 0x01; /* end of file, no data read */ AL_result = 0x01; /* end of file, no data read */
...@@ -1734,7 +1734,7 @@ static void INT21_RandomBlockReadFromFCB( CONTEXT86 *context ) ...@@ -1734,7 +1734,7 @@ static void INT21_RandomBlockReadFromFCB( CONTEXT86 *context )
AL_result = 0x03; /* end of file, partial record read */ AL_result = 0x03; /* end of file, partial record read */
} /* if */ } /* if */
} else { } else {
TRACE("successful read %d bytes from record %d (position %ld) of file %d (handle %p)\n", TRACE("successful read %d bytes from record %d (position %u) of file %d (handle %p)\n",
bytes_read, record_number, position, fcb->file_number, handle); bytes_read, record_number, position, fcb->file_number, handle);
records_read = records_requested; records_read = records_requested;
AL_result = 0x00; /* successful */ AL_result = 0x00; /* successful */
...@@ -1780,7 +1780,7 @@ static void INT21_RandomBlockWriteToFCB( CONTEXT86 *context ) ...@@ -1780,7 +1780,7 @@ static void INT21_RandomBlockWriteToFCB( CONTEXT86 *context )
struct XFCB *xfcb; struct XFCB *xfcb;
HANDLE handle; HANDLE handle;
DWORD record_number; DWORD record_number;
long position; DWORD position;
BYTE *disk_transfer_area; BYTE *disk_transfer_area;
UINT records_requested; UINT records_requested;
UINT bytes_requested; UINT bytes_requested;
...@@ -1804,7 +1804,7 @@ static void INT21_RandomBlockWriteToFCB( CONTEXT86 *context ) ...@@ -1804,7 +1804,7 @@ static void INT21_RandomBlockWriteToFCB( CONTEXT86 *context )
} else { } else {
position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0); position = SetFilePointer(handle, record_number * fcb->logical_record_size, NULL, 0);
if (position != record_number * fcb->logical_record_size) { if (position != record_number * fcb->logical_record_size) {
TRACE("seek(%d, %d, 0) failed with %ld\n", TRACE("seek(%d, %d, 0) failed with %u\n",
fcb->file_number, record_number * fcb->logical_record_size, position); fcb->file_number, record_number * fcb->logical_record_size, position);
records_written = 0; records_written = 0;
AL_result = 0x01; /* disk full */ AL_result = 0x01; /* disk full */
...@@ -1819,7 +1819,7 @@ static void INT21_RandomBlockWriteToFCB( CONTEXT86 *context ) ...@@ -1819,7 +1819,7 @@ static void INT21_RandomBlockWriteToFCB( CONTEXT86 *context )
records_written = bytes_written / fcb->logical_record_size; records_written = bytes_written / fcb->logical_record_size;
AL_result = 0x01; /* disk full */ AL_result = 0x01; /* disk full */
} else { } else {
TRACE("successful write %d bytes from record %d (position %ld) of file %d (handle %p)\n", TRACE("successful write %d bytes from record %d (position %u) of file %d (handle %p)\n",
bytes_written, record_number, position, fcb->file_number, handle); bytes_written, record_number, position, fcb->file_number, handle);
records_written = records_requested; records_written = records_requested;
AL_result = 0x00; /* successful */ AL_result = 0x00; /* successful */
...@@ -2733,7 +2733,7 @@ static void INT21_IoctlHPScanHandler( CONTEXT86 *context ) ...@@ -2733,7 +2733,7 @@ static void INT21_IoctlHPScanHandler( CONTEXT86 *context )
*/ */
static void INT21_Ioctl_Char( CONTEXT86 *context ) static void INT21_Ioctl_Char( CONTEXT86 *context )
{ {
int status, i; int status;
int IsConsoleIOHandle = 0; int IsConsoleIOHandle = 0;
IO_STATUS_BLOCK io; IO_STATUS_BLOCK io;
FILE_INTERNAL_INFORMATION info; FILE_INTERNAL_INFORMATION info;
...@@ -2750,6 +2750,7 @@ static void INT21_Ioctl_Char( CONTEXT86 *context ) ...@@ -2750,6 +2750,7 @@ static void INT21_Ioctl_Char( CONTEXT86 *context )
return; return;
} }
} else { } else {
UINT i;
for (i = 0; i < NB_MAGIC_DEVICES; i++) for (i = 0; i < NB_MAGIC_DEVICES; i++)
{ {
if (!magic_devices[i].handle) continue; if (!magic_devices[i].handle) continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment