krnl386.exe16: Use BOOL type where appropriate

Frédéric Delanoy frederic.delanoy at gmail.com
Sat Dec 14 11:16:56 CST 2013


Note: DPMI_FreeRMCB return value changed to return success when freeing was successful
---
 dlls/krnl386.exe16/int31.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/dlls/krnl386.exe16/int31.c b/dlls/krnl386.exe16/int31.c
index 5eddcca..c488c62 100644
--- a/dlls/krnl386.exe16/int31.c
+++ b/dlls/krnl386.exe16/int31.c
@@ -702,10 +702,11 @@ FARPROC16 DPMI_AllocInternalRMCB( RMCBPROC proc )
 }
 
 
-static int DPMI_FreeRMCB( DWORD address )
+static BOOL DPMI_FreeRMCB( DWORD address )
 {
     RMCB *CurrRMCB = FirstRMCB;
     RMCB *PrevRMCB = NULL;
+    BOOL ret;
 
     while (CurrRMCB && (CurrRMCB->address != address))
     {
@@ -715,14 +716,15 @@ static int DPMI_FreeRMCB( DWORD address )
     if (CurrRMCB)
     {
 	if (PrevRMCB)
-	PrevRMCB->next = CurrRMCB->next;
-	    else
-	FirstRMCB = CurrRMCB->next;
-	DOSMEM_FreeBlock(PTR_REAL_TO_LIN(SELECTOROF(CurrRMCB->address),OFFSETOF(CurrRMCB->address)));
+            PrevRMCB->next = CurrRMCB->next;
+        else
+            FirstRMCB = CurrRMCB->next;
+        ret = DOSMEM_FreeBlock(PTR_REAL_TO_LIN(SELECTOROF(CurrRMCB->address),
+                               OFFSETOF(CurrRMCB->address)));
 	HeapFree(GetProcessHeap(), 0, CurrRMCB);
-	return 0;
+        return ret;
     }
-    return 1;
+    return FALSE;
 }
 
 
@@ -823,7 +825,7 @@ static void DOSVM_FreeRMCB( CONTEXT *context )
     FIXME("callback address: %04x:%04x\n",
           CX_reg(context), DX_reg(context));
 
-    if (DPMI_FreeRMCB(MAKELONG(DX_reg(context), CX_reg(context)))) {
+    if (!DPMI_FreeRMCB(MAKELONG(DX_reg(context), CX_reg(context)))) {
 	SET_AX( context, 0x8024 ); /* invalid callback address */
 	SET_CFLAG(context);
     }
-- 
1.8.5




More information about the wine-patches mailing list