Commit 8a10493e authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

krnl386.exe16: Use BOOL type where appropriate.

parent e0d5010f
......@@ -404,7 +404,7 @@ extern void WINAPI DOSVM_Int15Handler(CONTEXT*);
/* int16.c */
extern void WINAPI DOSVM_Int16Handler(CONTEXT*);
extern BOOL DOSVM_Int16ReadChar( BYTE *, BYTE *, CONTEXT * );
extern int DOSVM_Int16AddChar(BYTE ascii,BYTE scan);
extern BOOL DOSVM_Int16AddChar(BYTE ascii, BYTE scan);
/* int21.c */
extern void WINAPI DOSVM_Int21Handler(CONTEXT*);
......
......@@ -195,7 +195,7 @@ BOOL DOSVM_Int16ReadChar(BYTE *ascii, BYTE *scan, CONTEXT *waitctx)
return TRUE;
}
int DOSVM_Int16AddChar(BYTE ascii,BYTE scan)
BOOL DOSVM_Int16AddChar(BYTE ascii,BYTE scan)
{
BIOSDATA *data = DOSVM_BiosData();
WORD CurOfs = data->FirstKbdCharPtr;
......@@ -204,12 +204,12 @@ int DOSVM_Int16AddChar(BYTE ascii,BYTE scan)
TRACE("(%02x,%02x)\n",ascii,scan);
if (NextOfs >= data->KbdBufferEnd) NextOfs = data->KbdBufferStart;
/* check if buffer is full */
if (NextOfs == data->NextKbdCharPtr) return 0;
if (NextOfs == data->NextKbdCharPtr) return FALSE;
/* okay, insert character in ring buffer */
((BYTE*)data)[CurOfs] = ascii;
((BYTE*)data)[CurOfs+1] = scan;
data->FirstKbdCharPtr = NextOfs;
return 1;
return TRUE;
}
......@@ -3437,7 +3437,7 @@ static int INT21_GetDiskSerialNumber( CONTEXT *context )
* INT21_SetDiskSerialNumber
*
*/
static int INT21_SetDiskSerialNumber( CONTEXT *context )
static BOOL INT21_SetDiskSerialNumber( CONTEXT *context )
{
#if 0
BYTE *dataptr = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx);
......@@ -3446,15 +3446,15 @@ static int INT21_SetDiskSerialNumber( CONTEXT *context )
if (!is_valid_drive(drive))
{
SetLastError( ERROR_INVALID_DRIVE );
return 0;
return FALSE;
}
DRIVE_SetSerialNumber( drive, *(DWORD *)(dataptr + 2) );
return 1;
return TRUE;
#else
FIXME("Setting drive serial number is no longer supported\n");
SetLastError( ERROR_NOT_SUPPORTED );
return 0;
return FALSE;
#endif
}
......@@ -3463,7 +3463,7 @@ static int INT21_SetDiskSerialNumber( CONTEXT *context )
* INT21_GetFreeDiskSpace
*
*/
static int INT21_GetFreeDiskSpace( CONTEXT *context )
static BOOL INT21_GetFreeDiskSpace( CONTEXT *context )
{
DWORD cluster_sectors, sector_bytes, free_clusters, total_clusters;
WCHAR root[] = {'A',':','\\',0};
......@@ -3473,7 +3473,8 @@ static int INT21_GetFreeDiskSpace( CONTEXT *context )
root[0] += INT21_MapDrive(DL_reg(context));
if (!GetDiskFreeSpaceW( root, &cluster_sectors, &sector_bytes,
&free_clusters, &total_clusters )) return 0;
&free_clusters, &total_clusters ))
return FALSE;
/* Some old win31 apps (Lotus SmartSuite 5.1) crap out if there's too
* much disk space, so Windows XP seems to apply the following limits:
......@@ -3530,19 +3531,19 @@ static int INT21_GetFreeDiskSpace( CONTEXT *context )
SET_BX( context, free_clusters );
SET_CX( context, sector_bytes );
SET_DX( context, total_clusters );
return 1;
return TRUE;
}
/******************************************************************
* INT21_GetDriveAllocInfo
*
*/
static int INT21_GetDriveAllocInfo( CONTEXT *context, BYTE drive )
static BOOL INT21_GetDriveAllocInfo( CONTEXT *context, BYTE drive )
{
INT21_DPB *dpb;
drive = INT21_MapDrive( drive );
if (!INT21_FillDrivePB( drive )) return 0;
if (!INT21_FillDrivePB( drive )) return FALSE;
dpb = &(INT21_GetHeapPointer()->misc_dpb_list[drive]);
SET_AL( context, dpb->cluster_sectors + 1 );
SET_CX( context, dpb->sector_bytes );
......@@ -3550,7 +3551,7 @@ static int INT21_GetDriveAllocInfo( CONTEXT *context, BYTE drive )
context->SegDs = INT21_GetHeapSelector( context );
SET_BX( context, offsetof( INT21_HEAP, misc_dpb_list[drive].media_ID ) );
return 1;
return TRUE;
}
/***********************************************************************
......@@ -3800,7 +3801,7 @@ static const WCHAR *INT21_FindPath; /* will point to current dta->fullPath searc
/******************************************************************
* INT21_FindFirst
*/
static int INT21_FindFirst( CONTEXT *context )
static BOOL INT21_FindFirst( CONTEXT *context )
{
WCHAR *p, *q;
const char *path;
......@@ -3829,7 +3830,7 @@ static int INT21_FindFirst( CONTEXT *context )
SetLastError( ERROR_FILE_NOT_FOUND );
SET_AX( context, ERROR_FILE_NOT_FOUND );
SET_CFLAG(context);
return 0;
return FALSE;
}
WideCharToMultiByte(CP_OEMCP, 0, maskW, 12, dta->mask, sizeof(dta->mask), NULL, NULL);
......@@ -3842,7 +3843,7 @@ static int INT21_FindFirst( CONTEXT *context )
dta->drive = toupperW(dta->fullPath[0]) - 'A';
dta->count = 0;
dta->search_attr = CL_reg(context);
return 1;
return TRUE;
}
/******************************************************************
......@@ -3930,14 +3931,14 @@ static unsigned INT21_FindHelper(LPCWSTR fullPath, unsigned drive, unsigned coun
/******************************************************************
* INT21_FindNext
*/
static int INT21_FindNext( CONTEXT *context )
static BOOL INT21_FindNext( CONTEXT *context )
{
FINDFILE_DTA *dta = (FINDFILE_DTA *)INT21_GetCurrentDTA(context);
DWORD attr = dta->search_attr | FA_UNUSED | FA_ARCHIVE | FA_RDONLY;
WIN32_FIND_DATAW entry;
int n;
if (!dta->fullPath) return 0;
if (!dta->fullPath) return FALSE;
n = INT21_FindHelper(dta->fullPath, dta->drive, dta->count,
dta->mask, attr, &entry);
......@@ -3962,11 +3963,11 @@ static int INT21_FindNext( CONTEXT *context )
INT21_FindPath = dta->fullPath = NULL;
}
dta->count = n;
return 1;
return TRUE;
}
HeapFree( GetProcessHeap(), 0, dta->fullPath );
INT21_FindPath = dta->fullPath = NULL;
return 0;
return FALSE;
}
/* microsoft's programmers should be shot for using CP/M style int21
......@@ -3976,7 +3977,7 @@ static int INT21_FindNext( CONTEXT *context )
* INT21_FindFirstFCB
*
*/
static int INT21_FindFirstFCB( CONTEXT *context )
static BOOL INT21_FindFirstFCB( CONTEXT *context )
{
BYTE *fcb = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx);
FINDFILE_FCB *pFCB;
......@@ -3986,21 +3987,21 @@ static int INT21_FindFirstFCB( CONTEXT *context )
if (*fcb == 0xff) pFCB = (FINDFILE_FCB *)(fcb + 7);
else pFCB = (FINDFILE_FCB *)fcb;
drive = INT21_MapDrive( pFCB->drive );
if (drive == MAX_DOS_DRIVES) return 0;
if (drive == MAX_DOS_DRIVES) return FALSE;
p[0] = 'A' + drive;
pFCB->fullPath = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
if (!pFCB->fullPath) return 0;
if (!pFCB->fullPath) return FALSE;
GetLongPathNameW(p, pFCB->fullPath, MAX_PATH);
pFCB->count = 0;
return 1;
return TRUE;
}
/******************************************************************
* INT21_FindNextFCB
*
*/
static int INT21_FindNextFCB( CONTEXT *context )
static BOOL INT21_FindNextFCB( CONTEXT *context )
{
BYTE *fcb = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx);
FINDFILE_FCB *pFCB;
......@@ -4022,14 +4023,14 @@ static int INT21_FindNextFCB( CONTEXT *context )
pFCB = (FINDFILE_FCB *)fcb;
}
if (!pFCB->fullPath) return 0;
if (!pFCB->fullPath) return FALSE;
n = INT21_FindHelper(pFCB->fullPath, INT21_MapDrive( pFCB->drive ),
pFCB->count, pFCB->filename, attr, &entry);
if (!n)
{
HeapFree( GetProcessHeap(), 0, pFCB->fullPath );
INT21_FindPath = pFCB->fullPath = NULL;
return 0;
return FALSE;
}
pFCB->count += n;
......@@ -4055,7 +4056,7 @@ static int INT21_FindNextFCB( CONTEXT *context )
else
INT21_ToDosFCBFormat( entry.cFileName, nameW );
WideCharToMultiByte(CP_OEMCP, 0, nameW, 11, ddl->filename, 11, NULL, NULL);
return 1;
return TRUE;
}
......
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