Removed trailing whitespace.

diff --git a/programs/avitools/aviinfo.c b/programs/avitools/aviinfo.c
index 1f717f8..fca40ac 100644
--- a/programs/avitools/aviinfo.c
+++ b/programs/avitools/aviinfo.c
@@ -62,7 +62,7 @@
 	XXT(AVIStreamInfo);
 #undef XX
 #undef XXT
-    
+
     fnAVIFileInit();
     if (-1==GetFileAttributes(cmdline)) {
     	fprintf(stderr,"Usage: aviinfo <avifilename>\n");
@@ -139,7 +139,7 @@
 	    case streamtypeVIDEO:
 	    	vids = ast;
 		break;
-	    case streamtypeAUDIO: 
+	    case streamtypeAUDIO:
 	    	auds = ast;
 		break;
 	    default:  {
@@ -154,5 +154,5 @@
     }
     fnAVIFileRelease(avif);
     fnAVIFileExit();
-    return 0;    
+    return 0;
 }
diff --git a/programs/avitools/aviplay.c b/programs/avitools/aviplay.c
index b013ff3..64e857d 100644
--- a/programs/avitools/aviplay.c
+++ b/programs/avitools/aviplay.c
@@ -1,6 +1,6 @@
 /*
  * Very simple AVIPLAYER
- * 
+ *
  * Copyright 1999 Marcus Meissner
  *
  * This library is free software; you can redistribute it and/or
@@ -16,7 +16,7 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- * 
+ *
  * Status:
  * 	- plays .avi streams, video only
  *	- requires MicroSoft avifil32.dll and builtin msvfw32.dll.
@@ -25,9 +25,9 @@
  *	- audio support (including synchronization etc)
  *	- replace DirectDraw by a 'normal' window, including dithering, controls
  *	  etc.
- *	
+ *
  * Bugs:
- *	- no time scheduling, video plays too fast using DirectDraw/XF86DGA 
+ *	- no time scheduling, video plays too fast using DirectDraw/XF86DGA
  *	- requires DirectDraw with all disadvantages.
  */
 
@@ -98,7 +98,7 @@
 #undef XX
 #undef XXT
 
-    
+
     fnAVIFileInit();
     if (-1==GetFileAttributes(cmdline)) {
     	fprintf(stderr,"Usage: aviplay <avifilename>\n");
@@ -137,7 +137,7 @@
 	    case streamtypeVIDEO:
 	    	vids = ast;
 		break;
-	    case streamtypeAUDIO: 
+	    case streamtypeAUDIO:
 	    	auds = ast;
 		break;
 	    default:  {
@@ -277,5 +277,5 @@
     fprintf(stderr,"%d frames at %g frames/s\n",pos,pos*1.0/(tend-tstart));
     fnAVIFileRelease(avif);
     fnAVIFileExit();
-    return 0;    
+    return 0;
 }
diff --git a/programs/avitools/icinfo.c b/programs/avitools/icinfo.c
index 64b9b7e..7bad5ac 100644
--- a/programs/avitools/icinfo.c
+++ b/programs/avitools/icinfo.c
@@ -89,6 +89,6 @@
 		ICConfigure(hic,0);
 	fnICClose(hic);
     }
-    return 0;    
+    return 0;
 }
 
diff --git a/programs/clock/language.c b/programs/clock/language.c
index 54f2af0..5495680 100644
--- a/programs/clock/language.c
+++ b/programs/clock/language.c
@@ -30,9 +30,9 @@
 VOID LANGUAGE_UpdateMenuCheckmarks(VOID) {
 
     if(Globals.bAnalog == TRUE) {
-    
+
         /* analog clock */
-        
+
         CheckMenuItem(Globals.hPropertiesMenu, 0x100, \
                        MF_BYCOMMAND | MF_CHECKED);
         CheckMenuItem(Globals.hPropertiesMenu, 0x101, \
@@ -40,20 +40,20 @@
         EnableMenuItem(Globals.hPropertiesMenu, 0x103, \
                        MF_BYCOMMAND | MF_GRAYED);
     }
-        else 
+        else
     {
-    
+
         /* digital clock */
-        
+
         CheckMenuItem(Globals.hPropertiesMenu, 0x100, \
                        MF_BYCOMMAND | MF_UNCHECKED);
         CheckMenuItem(Globals.hPropertiesMenu, 0x101, \
                        MF_BYCOMMAND | MF_CHECKED);
         EnableMenuItem(Globals.hPropertiesMenu, 0x103, \
                        MF_BYCOMMAND);
-                       
+
     }
-    
+
     CheckMenuItem(Globals.hPropertiesMenu, 0x105, MF_BYCOMMAND | \
                  (Globals.bWithoutTitle ? MF_CHECKED : MF_UNCHECKED));
     CheckMenuItem(Globals.hSystemMenu, 0x10D, MF_BYCOMMAND | \
@@ -68,9 +68,9 @@
 
   CHAR szCaption[MAX_STRING_LEN];
   CHAR szDate[MAX_STRING_LEN];
-  
+
   LPSTR date = szDate;
-  
+
   SYSTEMTIME st;
   LPSYSTEMTIME lpst = &st;
 
@@ -110,7 +110,7 @@
   /* specific for Clock: */
 
   LANGUAGE_UpdateMenuCheckmarks();
-  LANGUAGE_UpdateWindowCaption();   
+  LANGUAGE_UpdateWindowCaption();
 
   Globals.hSystemMenu = GetSystemMenu(Globals.hMainWnd, TRUE);
 
diff --git a/programs/clock/license.h b/programs/clock/license.h
index 6dac3b2..94dd3e8 100644
--- a/programs/clock/license.h
+++ b/programs/clock/license.h
@@ -21,7 +21,7 @@
 
 
 /* function prototypes */
- 
+
 VOID WineLicense(HWND hWnd);
 VOID WineWarranty(HWND hWnd);
 
@@ -37,7 +37,7 @@
 
 /* external references */
 
-/* 
+/*
 extern LICENSE WineLicense_Ca;
 extern LICENSE WineLicense_Cz;
 extern LICENSE WineLicense_Da;
diff --git a/programs/clock/main.c b/programs/clock/main.c
index 9b39a70..c439676 100644
--- a/programs/clock/main.c
+++ b/programs/clock/main.c
@@ -43,23 +43,23 @@
  */
 
 int CLOCK_MenuCommand (WPARAM wParam)
-{  
+{
 CHAR szApp[MAX_STRING_LEN];
 CHAR szAppRelease[MAX_STRING_LEN];
    switch (wParam) {
 	/* switch to analog */
-     case 0x100: { 
+     case 0x100: {
          Globals.bAnalog = TRUE;
          LANGUAGE_UpdateMenuCheckmarks();
 	 SendMessage(Globals.hMainWnd, WM_PAINT, 0, 0);
-	 break;	     
-       } 
+	 break;
+       }
 	/* switch to digital */
      case 0x101: {
          Globals.bAnalog = FALSE;
          LANGUAGE_UpdateMenuCheckmarks();
 	 SendMessage(Globals.hMainWnd, WM_PAINT, 0, 0);
-	 break;	       
+	 break;
        }
 	/* change font */
      case 0x103: {
@@ -67,18 +67,18 @@
          break;
        }
 	/* hide title bar */
-     case 0x105: {     
+     case 0x105: {
          Globals.bWithoutTitle = !Globals.bWithoutTitle;
          LANGUAGE_UpdateWindowCaption();
          LANGUAGE_UpdateMenuCheckmarks();
          break;
-       } 
+       }
 	/* always on top */
      case 0x10D: {
          Globals.bAlwaysOnTop = !Globals.bAlwaysOnTop;
          LANGUAGE_UpdateMenuCheckmarks();
          break;
-       }  
+       }
 	/* show or hide seconds */
      case 0x107: {
          Globals.bSeconds = !Globals.bSeconds;
@@ -113,7 +113,7 @@
        }
      /* Handle languages */
 /*     default:
-         LANGUAGE_DefaultHandle(wParam); 
+         LANGUAGE_DefaultHandle(wParam);
 */
    }
    return 0;
@@ -166,7 +166,7 @@
         case WM_RBUTTONUP: {
 	    printf("WM_RBUTTONUP\n");
             Globals.bWithoutTitle = !Globals.bWithoutTitle;
-            LANGUAGE_UpdateMenuCheckmarks();               
+            LANGUAGE_UpdateMenuCheckmarks();
             LANGUAGE_UpdateWindowCaption();
             UpdateWindow (Globals.hMainWnd);
             break;
@@ -179,7 +179,7 @@
 	        DrawFace(context);
 	        Idle(context);
 	    }
-	       else 
+	       else
             {
                /* do nothing */
             }
@@ -196,11 +196,11 @@
             OldSecond.DontRedraw = TRUE;
 	    break;
         }
-	  
+
         case WM_COMMAND: {
             CLOCK_MenuCommand(wParam);
             break;
-        } 
+        }
 
         case WM_DESTROY: {
             printf("WM_DESTROY\n");
@@ -225,7 +225,7 @@
 {
     MSG      msg;
     WNDCLASS class;
-    
+
     char szClassName[] = "CLClass";  /* To make sure className >= 0x10000 */
     char szWinName[]   = "Clock";
 
@@ -236,10 +236,10 @@
     Globals.lpszIcoFile     = "clock.ico";
 
     Globals.hInstance       = hInstance;
-    Globals.hMainIcon       = ExtractIcon(Globals.hInstance, 
+    Globals.hMainIcon       = ExtractIcon(Globals.hInstance,
                                           Globals.lpszIcoFile, 0);
-                                          
-    if (!Globals.hMainIcon) Globals.hMainIcon = 
+
+    if (!Globals.hMainIcon) Globals.hMainIcon =
                                   LoadIcon(0, MAKEINTRESOURCE(DEFAULTICON));
 
     if (!prev){
@@ -260,7 +260,7 @@
     Globals.hMainWnd = CreateWindow (szClassName, szWinName, WS_OVERLAPPEDWINDOW,
         CW_USEDEFAULT, CW_USEDEFAULT, Globals.MaxX, Globals.MaxY, 0,
         LoadMenu(Globals.hInstance, STRING_MENU_Xx), Globals.hInstance, 0);
-			
+
     LANGUAGE_LoadMenus();
     SetMenu(Globals.hMainWnd, Globals.hMainMenu);
 
@@ -281,6 +281,6 @@
     }
 
     /* We will never reach the following statement !   */
-    return 0;    
+    return 0;
 }
 
diff --git a/programs/clock/main.h b/programs/clock/main.h
index 79f08b0..7e8f8b6 100644
--- a/programs/clock/main.h
+++ b/programs/clock/main.h
@@ -50,7 +50,7 @@
   BOOL    bAlwaysOnTop;
   BOOL    bWithoutTitle;
   BOOL    bSeconds;
-  BOOL    bDate;  
+  BOOL    bDate;
 
   int     MaxX;
   int     MaxY;
@@ -67,11 +67,11 @@
 extern CHAR STRING_MENU_Xx[];
 
    #define STRINGID(id) (0x##id + Globals.wStringTableOffset)
-   
+
 #else  /* RC_INVOKED */
 
    #define STRINGID(id) id
-   
+
 #endif
 
 /* string table index */
diff --git a/programs/clock/winclock.c b/programs/clock/winclock.c
index b96839b..16c8926 100644
--- a/programs/clock/winclock.c
+++ b/programs/clock/winclock.c
@@ -1,4 +1,4 @@
-/* 
+/*
  *  Clock (winclock.c)
  *
  *  Copyright 1998 by Marcel Baur <mbaur@g26.ethz.ch>
@@ -45,7 +45,7 @@
 int MiddleX(void) {
   int X, diff;
 
-  X    = (Globals.MaxX/2);  
+  X    = (Globals.MaxX/2);
   diff = (Globals.MaxX-Globals.MaxY);
   if (diff>0) { X = (X-(diff/2)); }
   return X;
@@ -53,7 +53,7 @@
 
 int MiddleY(void) {
   int Y, diff;
-  
+
   Y    = (Globals.MaxY/2);
   diff = (Globals.MaxX-Globals.MaxY);
   if (diff<0) { Y = Y+(diff/2); }
@@ -63,7 +63,7 @@
 void DrawFace(HDC dc)
 {
   int MidX, MidY, t, DiffX, DiffY;
-  
+
   MidX = MiddleX();
   MidY = MiddleY();
   DiffX = (Globals.MaxX-MidX*2)/2;
@@ -119,7 +119,7 @@
   Sx = MidX; Sy = MidY;
   Ex = MidX+sin(Pos*Pi/6000)*XExt;
   Ey = MidY-cos(Pos*Pi/6000)*YExt;
-  rv = ( Sx!=OldHour.StartX || Ex!=OldHour.EndX || 
+  rv = ( Sx!=OldHour.StartX || Ex!=OldHour.EndX ||
 	 Sy!=OldHour.StartY || Ey!=OldHour.EndY );
   if (Globals.bAnalog && rv)DrawHourHand(dc);
   OldHour.StartX = Sx; OldHour.EndX = Ex;
@@ -152,7 +152,7 @@
   BOOL rv;
 
   rv = FALSE;
-  
+
   if (Globals.bSeconds) {
     Sx = MidX; Sy = MidY;
     Ex = MidX+sin(Pos*Pi/3000)*XExt;
@@ -164,7 +164,7 @@
     OldSecond.StartY = Sy; OldSecond.EndY = Ey;
     OldSecond.DontRedraw=FALSE;
   }
-  
+
   return rv;
 }
 
@@ -174,23 +174,23 @@
   LPSTR time = szTime;
   static short xChar, yChar;
   TEXTMETRIC tm;
-  
+
   SYSTEMTIME st;
   LPSYSTEMTIME lpst = &st;
-  
+
   GetLocalTime(&st);
-  GetTimeFormat(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, lpst, NULL, time, 
+  GetTimeFormat(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, lpst, NULL, time,
                 MAX_STRING_LEN);
-                
+
   SelectObject(dc,CreatePen(PS_SOLID,1,FaceColor));
   xChar = tm.tmAveCharWidth;
   yChar = tm.tmHeight;
-  
+
   xChar = 100;
   yChar = 100;
-  TextOut (dc, xChar, yChar, szTime, strlen (szTime)); 
+  TextOut (dc, xChar, yChar, szTime, strlen (szTime));
   DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN)));
-              
+
 }
 
 
@@ -231,8 +231,8 @@
         DrawMinuteHand(dc);
         DrawHourHand(dc);
       }
-  DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN))); 
-  
+  DeleteObject(SelectObject(dc,GetStockObject(NULL_PEN)));
+
 }
 
 void Idle(HDC idc)
@@ -250,7 +250,7 @@
   {
     AnalogClock(context);
   }
-  else 
+  else
   {
     DigitalClock(context);
   }
diff --git a/programs/clock/winclock.h b/programs/clock/winclock.h
index 199b9ab..3f5e8b4 100644
--- a/programs/clock/winclock.h
+++ b/programs/clock/winclock.h
@@ -1,4 +1,4 @@
-/* 
+/*
  *  Clock (winclock.h)
  *
  *  Copyright 1998 by Marcel Baur <mbaur@g26.ethz.ch>
@@ -22,7 +22,7 @@
  */
 
  #include <windows.h>
- 
+
 typedef struct
 {
   int StartX,StartY,EndX,EndY;
diff --git a/programs/control/control.c b/programs/control/control.c
index e4de144..3e8261c 100644
--- a/programs/control/control.c
+++ b/programs/control/control.c
@@ -1,4 +1,4 @@
-/* 
+/*
  *   Control
  *   Copyright (C) 1998 by Marcel Baur <mbaur@g26.ethz.ch>
  *
@@ -31,7 +31,7 @@
   exit(0);
 }
 
-int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc) 
+int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc)
 {
 
   char szParams[255];
@@ -69,5 +69,5 @@
 
     default: printf("Syntax error.");
   }
-  return 0;  
+  return 0;
 }
diff --git a/programs/control/params.h b/programs/control/params.h
index e721357..dcdb49f 100644
--- a/programs/control/params.h
+++ b/programs/control/params.h
@@ -1,4 +1,4 @@
-/* 
+/*
  *   Control
  *   Copyright (C) 1998 by Marcel Baur <mbaur@g26.ethz.ch>
  *
diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c
index e92313f..7daa511 100644
--- a/programs/notepad/dialog.c
+++ b/programs/notepad/dialog.c
@@ -36,15 +36,15 @@
 
 int AlertIDS(UINT ids_message, UINT ids_caption, WORD type) {
   /*
-   * Given some ids strings, this acts as a language-aware wrapper for 
+   * Given some ids strings, this acts as a language-aware wrapper for
    * "MessageBox"
    */
    CHAR szMessage[MAX_STRING_LEN];
    CHAR szCaption[MAX_STRING_LEN];
-   
+
    LoadString(Globals.hInstance, ids_message, szMessage, sizeof(szMessage));
    LoadString(Globals.hInstance, ids_caption, szCaption, sizeof(szCaption));
-   
+
    return (MessageBox(Globals.hMainWnd, szMessage, szCaption, type));
 }
 
@@ -57,7 +57,7 @@
    /* Load and format szMessage */
    LoadString(Globals.hInstance, STRING_NOTFOUND, szRessource, sizeof(szRessource));
    wsprintf(szMessage, szRessource, szFileName);
-   
+
    /* Load szCaption */
    LoadString(Globals.hInstance, STRING_ERROR,  szRessource, sizeof(szRessource));
 
@@ -76,7 +76,7 @@
 
    LoadString(Globals.hInstance, STRING_NOTSAVED, szRessource, sizeof(szRessource));
    wsprintf(szMessage, szRessource, szFileName);
-   
+
    /* Load Caption */
 
    LoadString(Globals.hInstance, STRING_ERROR,  szRessource, sizeof(szRessource));
@@ -89,7 +89,7 @@
 
 VOID AlertOutOfMemory(void) {
    int nResult;
-   
+
    nResult = AlertIDS(STRING_OUT_OF_MEMORY, STRING_ERROR, MB_ICONEXCLAMATION);
    PostQuitMessage(1);
 }
@@ -102,9 +102,9 @@
  */
    WIN32_FIND_DATA entry;
    HANDLE hFile;
-   
+
    hFile = FindFirstFile(szFilename, &entry);
-   
+
    return (hFile!=INVALID_HANDLE_VALUE);
 }
 
@@ -120,7 +120,7 @@
 /*               FALSE - User cancelled close by selecting "Cancel" */
 
     int nResult;
-   
+
     if (strlen(Globals.szFileName)>0) {
         /* prompt user to save changes */
         nResult = AlertFileNotSaved(Globals.szFileName);
@@ -132,12 +132,12 @@
 
             case IDCANCEL:  return(FALSE);
                             break;
-                      
+
             default:        return(FALSE);
                             break;
         } /* switch */
     } /* if */
-  
+
     /* Forget file name  */
     lstrcpy(Globals.szFileName, "");
     LANGUAGE_UpdateWindowCaption();
@@ -211,12 +211,12 @@
         openfilename.lpTemplateName    = 0;
 
         if (GetOpenFileName(&openfilename)) {
-                
+
                 if (FileExists(openfilename.lpstrFile))
                     DoOpenFile(openfilename.lpstrFile);
-                else 
+                else
                     AlertFileNotFound(openfilename.lpstrFile);
-                    
+
         }
 }
 
@@ -234,7 +234,7 @@
         CHAR szDir[MAX_PATHNAME_LEN];
         CHAR szDefaultExt[4];
         CHAR szzFilter[2 * MAX_STRING_LEN + 100];
-       
+
         LPSTR p = szzFilter;
 
         lstrcpy(szDefaultExt, "txt");
@@ -356,7 +356,7 @@
         if (TRUE) {
              /* Remove "Print Selection" if there is no selection */
              bFlags = bFlags + PD_NOSELECTION;
-        } 
+        }
 
         printer.Flags                 = bFlags;
 /*
@@ -414,7 +414,7 @@
                        AlertOutOfMemory();
                        break;
                default:
-                       MessageBox(Globals.hMainWnd, "Default", "Print", MB_ICONEXCLAMATION); 
+                       MessageBox(Globals.hMainWnd, "Default", "Print", MB_ICONEXCLAMATION);
             } /* switch */
             nResult = EndDoc(hContext);
             assert(nResult>=0);
@@ -454,7 +454,7 @@
         printer.lpSetupTemplateName  = 0;
         printer.hPrintTemplate       = 0;
         printer.hSetupTemplate       = 0;
-        
+
         if (PrintDlg(&printer)) {
             /* do nothing */
         };
@@ -538,7 +538,7 @@
     LPSYSTEMTIME lpst = &st;
     CHAR         szDate[MAX_STRING_LEN];
     LPSTR        date = szDate;
-    
+
     GetLocalTime(&st);
     GetDateFormat(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, lpst, NULL, date, MAX_STRING_LEN);
     GetTimeFormat(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, lpst, NULL, date, MAX_STRING_LEN);
@@ -548,7 +548,7 @@
 VOID DIALOG_EditWrap(VOID)
 {
         Globals.bWrapLongLines = !Globals.bWrapLongLines;
-        CheckMenuItem(Globals.hEditMenu, 0x119, MF_BYCOMMAND | 
+        CheckMenuItem(Globals.hEditMenu, 0x119, MF_BYCOMMAND |
         (Globals.bWrapLongLines ? MF_CHECKED : MF_UNCHECKED));
 }
 
diff --git a/programs/notepad/language.c b/programs/notepad/language.c
index 9f239e1..53ac7d1 100644
--- a/programs/notepad/language.c
+++ b/programs/notepad/language.c
@@ -33,12 +33,12 @@
       Notepad - (untitled)      if no file is open
       Notepad - [filename]      if a file is given
   */
-  
+
   CHAR szCaption[MAX_STRING_LEN];
   CHAR szUntitled[MAX_STRING_LEN];
 
   LoadString(Globals.hInstance, STRING_NOTEPAD, szCaption, sizeof(szCaption));
-  
+
   if (strlen(Globals.szFileName)>0) {
       lstrcat(szCaption, " - [");
       lstrcat(szCaption, Globals.szFileName);
@@ -50,9 +50,9 @@
       lstrcat(szCaption, " - ");
       lstrcat(szCaption, szUntitled);
   }
-    
+
   SetWindowText(Globals.hMainWnd, szCaption);
-  
+
 }
 
 
@@ -75,7 +75,7 @@
 
   /* Set frame caption */
   LANGUAGE_UpdateWindowCaption();
-  
+
   /* Change Resource names */
 //  lstrcpyn(STRING_MENU_Xx      + sizeof(STRING_MENU_Xx)      - 3, lang, 3);
 //  lstrcpyn(STRING_PAGESETUP_Xx + sizeof(STRING_PAGESETUP_Xx) - 3, lang, 3);
diff --git a/programs/notepad/license.h b/programs/notepad/license.h
index adbed7a..418bb66 100644
--- a/programs/notepad/license.h
+++ b/programs/notepad/license.h
@@ -27,7 +27,7 @@
   LPCSTR Warranty, WarrantyCaption;
 } LICENSE;
 
-/* 
+/*
 extern LICENSE WineLicense_Ca;
 extern LICENSE WineLicense_Cz;
 extern LICENSE WineLicense_Da;
@@ -36,7 +36,7 @@
 
 extern LICENSE WineLicense_En;
 
-/* 
+/*
 extern LICENSE WineLicense_Eo;
 extern LICENSE WineLicense_Es;
 extern LICENSE WineLicense_Fi;
diff --git a/programs/notepad/main.c b/programs/notepad/main.c
index 15feec1..770ab36 100644
--- a/programs/notepad/main.c
+++ b/programs/notepad/main.c
@@ -106,11 +106,11 @@
 
     if(y>dwLines)
         return size.cx;
-    if(lpBuffer == NULL) 
+    if(lpBuffer == NULL)
         return size.cx;
     if(lpBuffer[y].lpLine == NULL)
         return size.cx;
-    len = (x<lpBuffer[y].dwWidth) ? 
+    len = (x<lpBuffer[y].dwWidth) ?
            x : lpBuffer[y].dwWidth;
     GetTextExtentPoint(hDC, lpBuffer[y].lpLine, len, &size);
 
@@ -152,10 +152,10 @@
     hPrev = SelectObject(hDC, GetStockObject(WHITE_PEN));
     Rectangle(hDC, rect.left, rect.top, rect.right, rect.bottom);
     SelectObject(hDC, hPrev);
-    
+
     if(lpBuffer && lpBuffer[lineno].lpLine)
     {
-        TextOut(hDC, 0, rect.top, lpBuffer[lineno].lpLine, 
+        TextOut(hDC, 0, rect.top, lpBuffer[lineno].lpLine,
                        lpBuffer[lineno].dwWidth);
     }
 }
@@ -176,7 +176,7 @@
     }
 }
 
-/* 
+/*
  * Check that correct buffers exist to access line y pos x
  * Only manages memory.
  *
@@ -317,7 +317,7 @@
         RenderLine(hDC, dwYpos);
         CalcCaretPos(hDC,dwXpos,dwYpos);
     }
-    else 
+    else
     {
         /* Erase a newline. To do this we join two lines */
         LPSTR src, dest;
@@ -412,7 +412,7 @@
     BOOL nomore)
 {
     DWORD i;
-    
+
     if(size == 0)
         return 0;
 
@@ -446,8 +446,8 @@
 }
 
 
-/* 
- * This is probably overcomplicated by lpBuffer data structure... 
+/*
+ * This is probably overcomplicated by lpBuffer data structure...
  * Read blocks from the file, then add each line from the
  *  block to the buffer until there is none left. If all
  *  a slab isn't used, try load some more data from the file.
@@ -470,15 +470,15 @@
     bytes_left = 0;
     while(bytes_read)
     {
-        if(!ReadFile(hFile, 
-                     &pTemp[bytes_left], 
-                     size-bytes_left, 
+        if(!ReadFile(hFile,
+                     &pTemp[bytes_left],
+                     size-bytes_left,
                      &bytes_read, NULL))
             break;
         bytes_left+=bytes_read;
 
         /* add strings to buffer */
-        for(i = 0; 
+        for(i = 0;
             (i<size) &&
             (len  = CreateLine(&pTemp[i], bytes_left, !bytes_read));
             i+= len,bytes_left-=len );
@@ -546,7 +546,7 @@
         dwXpos--;
         return TRUE;
     }
-    if(GotoUp(hWnd))   
+    if(GotoUp(hWnd))
         return GotoEndOfLine(hWnd);
     return FALSE;
 }
@@ -672,7 +672,7 @@
                 caretx--;
         }
     }
-    
+
     /* set the caret's position */
     dwXpos = caretx;
     dwYpos = carety;
@@ -715,7 +715,7 @@
  */
 
 int NOTEPAD_MenuCommand (WPARAM wParam)
-{  
+{
    switch (wParam) {
      case 0x100:          DIALOG_FileNew(); break;
      case 0x101:         DIALOG_FileOpen(); break;
@@ -744,7 +744,7 @@
      case 0x135:      DIALOG_HelpLicense(); break;
      case 0x136:  DIALOG_HelpNoWarranty(); break;
      case 0x137:   DIALOG_HelpAboutWine(); break;
-     
+
 //     default:
 //      LANGUAGE_DefaultHandle(wParam);
    }
@@ -848,7 +848,7 @@
           DragQueryFile(hDrop, 0, (CHAR *) &szFileName, sizeof(szFileName));
           DragFinish(hDrop);
           DoOpenFile(szFileName);
-          break;        
+          break;
 
        default:
           return DefWindowProc (hWnd, msg, wParam, lParam);
@@ -865,20 +865,20 @@
    LoadString(Globals.hInstance, STRING_DOESNOTEXIST, szRessource,
               sizeof(szRessource));
    wsprintf(szMessage, szRessource, szFileName);
-   
+
    LoadString(Globals.hInstance, STRING_ERROR,  szRessource, sizeof(szRessource));
 
    nResult = MessageBox(Globals.hMainWnd, szMessage, szRessource,
                         MB_ICONEXCLAMATION | MB_YESNO);
-   
+
    return(nResult);
 }
 
 void HandleCommandLine(LPSTR cmdline)
 {
-    
-    while (*cmdline && (*cmdline == ' ' || *cmdline == '-')) 
-    
+
+    while (*cmdline && (*cmdline == ' ' || *cmdline == '-'))
+
     {
         CHAR   option;
 
@@ -897,22 +897,22 @@
         }
     }
 
-    if (*cmdline) 
+    if (*cmdline)
     {
         /* file name is passed in the command line */
         char *file_name;
         BOOL file_exists;
         char buf[MAX_PATH];
 
-        if (FileExists(cmdline)) 
+        if (FileExists(cmdline))
         {
             file_exists = TRUE;
             file_name = cmdline;
         }
-        else 
+        else
         {
-            /* try to find file with ".txt" extention */ 
-            if (!strcmp(".txt", cmdline + strlen(cmdline) - strlen(".txt"))) 
+            /* try to find file with ".txt" extention */
+            if (!strcmp(".txt", cmdline + strlen(cmdline) - strlen(".txt")))
             {
                 file_exists = FALSE;
                 file_name = cmdline;
@@ -969,7 +969,7 @@
     Globals.hInstance       = hInstance;
 
 #ifndef LCC
-    Globals.hMainIcon       = ExtractIcon(Globals.hInstance, 
+    Globals.hMainIcon       = ExtractIcon(Globals.hInstance,
                                         Globals.lpszIcoFile, 0);
 #endif
     if (!Globals.hMainIcon) {
@@ -1004,9 +1004,9 @@
     /* Setup windows */
 
 
-    Globals.hMainWnd = CreateWindow (className, winName, 
+    Globals.hMainWnd = CreateWindow (className, winName,
        WS_OVERLAPPEDWINDOW + WS_HSCROLL + WS_VSCROLL,
-       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 
+       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0,
        LoadMenu(Globals.hInstance, STRING_MENU_Xx),
        Globals.hInstance, 0);
 
@@ -1014,8 +1014,8 @@
 
    LANGUAGE_LoadMenus();
 
-    SetMenu(Globals.hMainWnd, Globals.hMainMenu);               
-                        
+    SetMenu(Globals.hMainWnd, Globals.hMainMenu);
+
     ShowWindow (Globals.hMainWnd, show);
     UpdateWindow (Globals.hMainWnd);
 
@@ -1025,7 +1025,7 @@
 
     Globals.nCommdlgFindReplaceMsg = RegisterWindowMessage("commdlg_FindReplace");
     if (Globals.nCommdlgFindReplaceMsg==0) {
-       MessageBox(Globals.hMainWnd, "Could not register commdlg_FindReplace window message", 
+       MessageBox(Globals.hMainWnd, "Could not register commdlg_FindReplace window message",
                   "Error", MB_ICONEXCLAMATION);
     }
 
@@ -1036,14 +1036,14 @@
     DragAcceptFiles(Globals.hMainWnd, TRUE);
 
     /* now enter mesage loop     */
-    
+
     while (GetMessage (&msg, 0, 0, 0)) {
         if (IsDialogMessage(Globals.hFindReplaceDlg, &msg)!=0) {
           /* Message belongs to FindReplace dialog */
           /* We just let IsDialogMessage handle it */
-        } 
+        }
           else
-        { 
+        {
           /* Message belongs to the Notepad Main Window */
           TranslateMessage (&msg);
           DispatchMessage (&msg);
diff --git a/programs/notepad/main.h b/programs/notepad/main.h
index cf68941..a3da15d 100644
--- a/programs/notepad/main.h
+++ b/programs/notepad/main.h
@@ -86,7 +86,7 @@
 /* Resource names */
 extern CHAR STRING_MENU_Xx[];
 extern CHAR STRING_PAGESETUP_Xx[];
-   
+
 #else  /* RC_INVOKED */
-   
+
 #endif
diff --git a/programs/notepad/search.c b/programs/notepad/search.c
index 75d41b0..f5b8698 100644
--- a/programs/notepad/search.c
+++ b/programs/notepad/search.c
@@ -24,22 +24,22 @@
  */
 
 #include <windows.h>
- 
+
  #define CHARSETSIZE 255
-  
+
  int delta[CHARSETSIZE];
- 
+
  /* rightmostpos: return rightmost position of ch in szSP (or -1) */
  int rightmostpos(char ch, LPSTR szSP, int nSPLen) {
     int i = nSPLen;
     while ((i>0) & (szSP[i]!=ch)) i--;
     return(i);
  }
- 
+
  /* setup_delta: setup delta1 cache */
  void setup_delta(LPSTR szSP, int nSPLen) {
     int i;
-    
+
     for (i=0; i<CHARSETSIZE; i++) {
        delta[i] = nSPLen;
     }
@@ -52,7 +52,7 @@
  int bm_search(LPSTR szBuf, int nBufLen, LPSTR szSP, int nSPLen) {
     int i = nSPLen;
     int j = nSPLen;
-    
+
     do {
        if ((szBuf[i] = szSP[j])) {
          i--; j--;
@@ -66,4 +66,4 @@
     } while (j>0 && i<=nBufLen);
     return(i+1);
  }
- 
+
diff --git a/programs/progman/grpfile.c b/programs/progman/grpfile.c
index 6594e4f..88c2d85 100644
--- a/programs/progman/grpfile.c
+++ b/programs/progman/grpfile.c
@@ -188,7 +188,7 @@
   lpszName = buffer + GET_USHORT(buffer, 22);
   if (lpszName >= buffer + size) return(0);
 
-  /* unknown bytes 24 - 31 ignored */ 
+  /* unknown bytes 24 - 31 ignored */
   /*
     Unknown bytes should be:
     wLogPixelsX = GET_SHORT(buffer, 24);
@@ -470,14 +470,14 @@
 /***********************************************************************
  *
  *           GRPFILE_WriteWithChecksum
- * 
+ *
  * Looks crazier than it is:
- * 
+ *
  * chksum = 0;
  * chksum = cksum - 1. word;
  * chksum = cksum - 2. word;
  * ...
- * 
+ *
  * if (filelen is even)
  *      great I'm finished
  * else
@@ -488,7 +488,7 @@
 {
 	UINT i;
 	if (GRPFILE_checksum_half_word) {
-		GRPFILE_checksum -= GRPFILE_checksum_last_byte;	
+		GRPFILE_checksum -= GRPFILE_checksum_last_byte;
 	}
 	for (i=0; i < size; i++) {
 		if (GRPFILE_checksum_half_word) {
@@ -498,12 +498,12 @@
 		}
 		GRPFILE_checksum_half_word ^= 1;
 	}
-	
+
 	if (GRPFILE_checksum_half_word) {
 		GRPFILE_checksum_last_byte = str[size-1];
 		GRPFILE_checksum += GRPFILE_checksum_last_byte;
 	}
-	
+
 	return _lwrite(file, str, size);
 }
 
@@ -523,9 +523,9 @@
   LPCSTR lpszTitle = LocalLock(group->hName);
 
   UINT16 checksum;
-	
+
   GRPFILE_InitChecksum();
-	
+
   /* Calculate offsets */
   NumProg = 0;
   Icons   = 0;
@@ -554,9 +554,9 @@
   /* Header */
   buffer[0] = 'P';
   buffer[1] = 'M';
-  buffer[2] = 'C'; 
+  buffer[2] = 'C';
   buffer[3] = 'C';
-	
+
   PUT_SHORT(buffer,  4, 0); /* Checksum zero for now, written later */
   PUT_SHORT(buffer,  6, Extension);
   /* Update group->nCmdShow */
@@ -588,7 +588,7 @@
       PROGRAM *program = LocalLock(hProgram);
 
       PUT_SHORT(buffer, 0, CurrProg);
-      if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, buffer, 2)) 
+      if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, buffer, 2))
 	      return FALSE;
 
       GRPFILE_CalculateSizes(program, &CurrProg, &CurrIcon);
@@ -596,7 +596,7 @@
     }
 
   /* Title */
-  if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, lpszTitle, 
+  if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, lpszTitle,
 					       lstrlen(lpszTitle) + 1))
     return FALSE;
 
@@ -675,7 +675,7 @@
       PUT_SHORT(buffer, 4, 0x000a);
       buffer[6] = 'P', buffer[7] = 'M';
       buffer[8] = 'C', buffer[9] = 'C';
-      if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, buffer, 10)) 
+      if ((UINT)HFILE_ERROR == GRPFILE_WriteWithChecksum(file, buffer, 10))
 	      return FALSE;
 
       seqnum = 0;
diff --git a/programs/progman/progman.h b/programs/progman/progman.h
index 3dd37d9..4fbc9e9 100644
--- a/programs/progman/progman.h
+++ b/programs/progman/progman.h
@@ -62,7 +62,7 @@
   /* pointer to iconANDbits */ /* 16 - 17 */ /* sometimes iconXORbits ?! */
   HLOCAL   hName;              /* 18 - 19 */
   HLOCAL   hCmdLine;           /* 20 - 21 */
-  HLOCAL   hIconFile;          /* 22 - 23 */        
+  HLOCAL   hIconFile;          /* 22 - 23 */
   HLOCAL   hWorkDir;           /* Extension 0x8101 */
   INT      nHotKey;            /* Extension 0x8102 */
   /* Modifier: bit 8... */
@@ -103,7 +103,7 @@
   HLOCAL   hPrograms;          /* 34 ...  */
 
   /**/                        /* Extensions */
-  /* Extension type */         /*  0 -  1 */           
+  /* Extension type */         /*  0 -  1 */
   /* Program number */         /*  2 -  3 */
   /* Size of entry  */         /*  4 -  5 */
   /* Data           */         /*  6 ...  */
diff --git a/programs/progman/program.c b/programs/progman/program.c
index 8ac6362..1060dd9 100644
--- a/programs/progman/program.c
+++ b/programs/progman/program.c
@@ -296,7 +296,7 @@
     ((PROGRAM*)LocalLock(program->hPrior))->hNext = program->hNext;
   else
     ((PROGGROUP*)LocalLock(program->hGroup))->hPrograms = program->hNext;
-	
+
   if (program->hNext)
     ((PROGRAM*)LocalLock(program->hNext))->hPrior = program->hPrior;
 
diff --git a/programs/regapi/regapi.c b/programs/regapi/regapi.c
index 79aa54f..e08c727 100644
--- a/programs/regapi/regapi.c
+++ b/programs/regapi/regapi.c
@@ -32,10 +32,10 @@
 /******************************************************************************
  * Defines and consts
  */
-#define IDENTICAL             0 
+#define IDENTICAL             0
 #define COMMAND_COUNT         7
 
-#define KEY_MAX_LEN             1024 
+#define KEY_MAX_LEN             1024
 #define STDIN_MAX_LEN         102400
 
 /* Return values */
@@ -56,16 +56,16 @@
 static BOOL  bTheKeyIsOpen    = FALSE;
 
 /* Delimiters used to parse the "value"="data" pair for setValue*/
-#define SET_VALUE_MAX_ARGS    2 
+#define SET_VALUE_MAX_ARGS    2
 /* Delimiters used to parse the "value" to query queryValue*/
-#define QUERY_VALUE_MAX_ARGS  1 
+#define QUERY_VALUE_MAX_ARGS  1
 
 static const char *setValueDelim[SET_VALUE_MAX_ARGS]   = {"=", ""};
 static const char *queryValueDelim[QUERY_VALUE_MAX_ARGS]   = {""};
 
 
-/* 
- * Forward declaration 
+/*
+ * Forward declaration
  */
 typedef void (*commandAPI)(LPSTR lpsLine);
 
@@ -81,8 +81,8 @@
  * Currently supported api
  */
 static const char* commandNames[COMMAND_COUNT] = {
-  "setValue", 
-  "deleteValue", 
+  "setValue",
+  "deleteValue",
   "createKey",
   "deleteKey",
   "queryValue",
@@ -94,8 +94,8 @@
  * Pointers to processing entry points
  */
 static const commandAPI commandAPIs[COMMAND_COUNT] = {
-  doSetValue, 
-  doDeleteValue, 
+  doSetValue,
+  doDeleteValue,
   doCreateKey,
   doDeleteKey,
   doQueryValue,
@@ -103,8 +103,8 @@
   doUnregisterDLL
 };
 
-/* 
- * This array controls the registry saving needs at the end of the process 
+/*
+ * This array controls the registry saving needs at the end of the process
  */
 static const BOOL commandSaveRegistry[COMMAND_COUNT] = {
   TRUE,
@@ -116,7 +116,7 @@
   TRUE
 };
 
-/* 
+/*
  * Generic prototypes
  */
 static DWORD   getDataType(LPSTR *lpValue, DWORD* parse_type);
@@ -131,13 +131,13 @@
 static HRESULT openKey(LPSTR stdInput);
 static void    closeKey();
 
-/* 
+/*
  * api setValue prototypes
  */
 static void    processSetValue(LPSTR cmdline);
 static HRESULT setValue(LPSTR *argv);
 
-/* 
+/*
  * api queryValue prototypes
  */
 static void    processQueryValue(LPSTR cmdline);
@@ -205,8 +205,8 @@
 
 
 /******************************************************************************
- * This function returns the HKEY associated with the data type encoded in the 
- * value.  It modifies the input parameter (key value) in order to skip this 
+ * This function returns the HKEY associated with the data type encoded in the
+ * value.  It modifies the input parameter (key value) in order to skip this
  * "now useless" data type information.
  *
  * Note: Updated based on the algorithm used in 'server/registry.c'
@@ -256,10 +256,10 @@
 }
 
 /******************************************************************************
- * Extracts from a [HKEY\some\key\path] type of line the key name (what starts 
+ * Extracts from a [HKEY\some\key\path] type of line the key name (what starts
  * after the first '\' and end before the ']'
  */
-LPSTR getRegKeyName(LPSTR lpLine) 
+LPSTR getRegKeyName(LPSTR lpLine)
 {
   LPSTR keyNameBeg = NULL;
   LPSTR keyNameEnd = NULL;
@@ -274,25 +274,25 @@
   keyNameBeg++;                            /* but is not part of the key name */
   keyNameEnd  = strstr(lpLineCopy, "]");   /* The key name end by ']' */
   *keyNameEnd = '\0';                      /* Isolate the key name */
- 
+
   currentKeyName = HeapAlloc(GetProcessHeap(), 0, strlen(keyNameBeg)+1);
   if (currentKeyName != NULL)
     strcpy(currentKeyName, keyNameBeg);
- 
+
   return currentKeyName;
 }
 
 /******************************************************************************
- * Extracts from a [HKEY/some/key/path] type of line the key class (what 
+ * Extracts from a [HKEY/some/key/path] type of line the key class (what
  * starts after the '[' and ends before the first '\'
  */
-static HKEY getRegClass(LPSTR lpClass) 
+static HKEY getRegClass(LPSTR lpClass)
 {
   LPSTR classNameEnd;
   LPSTR classNameBeg;
 
   char  lpClassCopy[KEY_MAX_LEN];
-  
+
   if (lpClass == NULL)
     return (HKEY)ERROR_INVALID_PARAMETER;
 
@@ -301,7 +301,7 @@
   classNameEnd  = strstr(lpClassCopy, "\\");  /* The class name end by '\' */
   *classNameEnd = '\0';                       /* Isolate the class name */
   classNameBeg  = &lpClassCopy[1];            /* Skip the '[' */
-  
+
   if      (strcmp( classNameBeg, "HKEY_LOCAL_MACHINE") == IDENTICAL )
     return  HKEY_LOCAL_MACHINE;
   else if (strcmp( classNameBeg, "HKEY_USERS") == IDENTICAL )
@@ -343,7 +343,7 @@
 }
 
 /******************************************************************************
- * Returns an allocated buffer with a cleaned copy (removed the surrounding 
+ * Returns an allocated buffer with a cleaned copy (removed the surrounding
  * dbl quotes) of the passed value.
  */
 static LPSTR getArg( LPSTR arg)
@@ -357,7 +357,7 @@
   /*
    * Get rid of surrounding quotes
    */
-  len = strlen(arg); 
+  len = strlen(arg);
 
   if( arg[len-1] == '\"' ) arg[len-1] = '\0';
   if( arg[0]     == '\"' ) arg++;
@@ -375,7 +375,7 @@
 {
   INT count;
   for (count=0; count < COMMAND_COUNT; count++)
-    if ( strcmp(commandName, commandNames[count]) == IDENTICAL) 
+    if ( strcmp(commandName, commandNames[count]) == IDENTICAL)
       return count;
 
   return COMMAND_NOT_FOUND;
@@ -397,7 +397,7 @@
 }
 
 /******************************************************************************
- * Converts a hex buffer into a hex comma separated values 
+ * Converts a hex buffer into a hex comma separated values
  */
 static char* convertHexToHexCSV(BYTE *buf, ULONG bufLen)
 {
@@ -420,7 +420,7 @@
     sprintf(res, "%02x", (unsigned int)*&bCur);
     strcat(str, res);
     strcat(str, ",");
-  }                                   
+  }
 
   /* Get rid of the last comma */
   str[strlen(str)-1] = '\0';
@@ -479,14 +479,14 @@
     s+=3;
     strPos+=3;
     byteCount++;
-  }                                   
+  }
 
   return byteCount;
 }
 
 
 /******************************************************************************
- * Sets the value in argv[0] to the data in argv[1] for the currently 
+ * Sets the value in argv[0] to the data in argv[1] for the currently
  * opened key.
  */
 static HRESULT setValue(LPSTR *argv)
@@ -507,7 +507,7 @@
 
   lpsCurrentValue=HeapAlloc(GetProcessHeap(), 0,KEY_MAX_LEN);
   /*
-   * Default registry values are encoded in the input stream as '@' but as 
+   * Default registry values are encoded in the input stream as '@' but as
    * blank in the wine registry.
    */
   if( (keyValue[0] == '@') && (strlen(keyValue) == 1) )
@@ -518,11 +518,11 @@
 
   memset(lpsCurrentValue, 0, KEY_MAX_LEN);
   hRes = RegQueryValueExA(
-          currentKeyHandle, 
-          keyValue, 
-          NULL, 
-          &dwType, 
-          (LPBYTE)lpsCurrentValue, 
+          currentKeyHandle,
+          keyValue,
+          NULL,
+          &dwType,
+          (LPBYTE)lpsCurrentValue,
           &dwSize);
 
   while(hRes==ERROR_MORE_DATA){
@@ -532,8 +532,8 @@
   }
 
   if( ( strlen(lpsCurrentValue) == 0 ) ||  /* The value is not existing */
-      ( bForce ))         /* -force option */ 
-  { 
+      ( bForce ))         /* -force option */
+  {
     LPBYTE lpbData;
     BYTE   convert[KEY_MAX_LEN];
     DWORD  dwLen;
@@ -547,7 +547,7 @@
         keyData[dwLen]='\0';
       }
       lpbData = keyData;
-    } 
+    }
     else if (dwParseType == REG_DWORD)  /* Convert the dword types */
     {
       dwLen   = convertHexToDWord(keyData, convert);
@@ -560,7 +560,7 @@
     }
 
     hRes = RegSetValueEx(
-            currentKeyHandle, 
+            currentKeyHandle,
             keyValue,
             0,                  /* Reserved */
             dwDataType,
@@ -594,11 +594,11 @@
  */
 static HRESULT openKey( LPSTR stdInput)
 {
-  DWORD   dwDisp;  
+  DWORD   dwDisp;
   HRESULT hRes;
 
   /* Sanity checks */
-  if (stdInput == NULL) 
+  if (stdInput == NULL)
     return ERROR_INVALID_PARAMETER;
 
   /* Get the registry class */
@@ -610,8 +610,8 @@
   currentKeyName = getRegKeyName(stdInput); /* Sets global variable */
   if (currentKeyName == NULL)
     return ERROR_INVALID_PARAMETER;
-    
-  hRes = RegCreateKeyEx( 
+
+  hRes = RegCreateKeyEx(
           currentKeyClass,          /* Class     */
           currentKeyName,           /* Sub Key   */
           0,                        /* MUST BE 0 */
@@ -630,7 +630,7 @@
 
 }
 /******************************************************************************
- * This function is a wrapper for the setValue function.  It prepares the 
+ * This function is a wrapper for the setValue function.  It prepares the
  * land and clean the area once completed.
  */
 static void processSetValue(LPSTR cmdline)
@@ -648,7 +648,7 @@
   for (counter=0; counter<SET_VALUE_MAX_ARGS; counter++)
     argv[counter]=NULL;
 
-  while( (token = getToken(&cmdline, setValueDelim[argCounter])) != NULL ) 
+  while( (token = getToken(&cmdline, setValueDelim[argCounter])) != NULL )
   {
     argv[argCounter++] = token;
 
@@ -657,29 +657,29 @@
   }
 
   hRes = setValue(argv);
-  if ( hRes == ERROR_SUCCESS ) 
+  if ( hRes == ERROR_SUCCESS )
     printf(
-      "regapi: Value \"%s\" has been set to \"%s\" in key [%s]\n", 
-      argv[0], 
+      "regapi: Value \"%s\" has been set to \"%s\" in key [%s]\n",
+      argv[0],
       argv[1],
       currentKeyName);
 
-  else if ( hRes == KEY_VALUE_ALREADY_SET ) 
+  else if ( hRes == KEY_VALUE_ALREADY_SET )
     printf(
-      "regapi: Value \"%s\" already set to \"%s\" in key [%s]\n", 
-      argv[0], 
-      argv[1], 
+      "regapi: Value \"%s\" already set to \"%s\" in key [%s]\n",
+      argv[0],
+      argv[1],
       currentKeyName);
 
   else
     printf("regapi: ERROR Key %s not created. Value: %s, Data: %s\n",
       currentKeyName,
-      argv[0], 
+      argv[0],
       argv[1]);
 }
 
 /******************************************************************************
- * This function is a wrapper for the queryValue function.  It prepares the 
+ * This function is a wrapper for the queryValue function.  It prepares the
  * land and clean the area once completed.
  */
 static void processQueryValue(LPSTR cmdline)
@@ -698,7 +698,7 @@
   for (counter=0; counter<QUERY_VALUE_MAX_ARGS; counter++)
     argv[counter]=NULL;
 
-  while( (token = getToken(&cmdline, queryValueDelim[argCounter])) != NULL ) 
+  while( (token = getToken(&cmdline, queryValueDelim[argCounter])) != NULL )
   {
     argv[argCounter++] = getArg(token);
 
@@ -710,18 +710,18 @@
   if ( argv[0] == NULL )
     return; /* SHOULD NOT HAPPEN */
   else
-    keyValue = argv[0]; 
+    keyValue = argv[0];
 
-  if( (keyValue[0] == '@') && (strlen(keyValue) == 1) ) 
+  if( (keyValue[0] == '@') && (strlen(keyValue) == 1) )
   {
     LONG  lLen  = KEY_MAX_LEN;
     CHAR*  lpsData=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,KEY_MAX_LEN);
-    /* 
+    /*
      * We need to query the key default value
      */
     hRes = RegQueryValue(
-             currentKeyHandle, 
-             currentKeyName, 
+             currentKeyHandle,
+             currentKeyName,
              (LPBYTE)lpsData,
              &lLen);
 
@@ -737,20 +737,20 @@
       lpsRes[lLen-1]='\0';
     }
   }
-  else 
+  else
   {
     DWORD  dwLen  = KEY_MAX_LEN;
     BYTE*  lpbData=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,KEY_MAX_LEN);
     DWORD  dwType;
-    /* 
+    /*
      * We need to query a specific value for the key
      */
     hRes = RegQueryValueEx(
-             currentKeyHandle, 
-             keyValue, 
-             0, 
-             &dwType, 
-             (LPBYTE)lpbData, 
+             currentKeyHandle,
+             keyValue,
+             0,
+             &dwType,
+             (LPBYTE)lpbData,
              &dwLen);
 
     if (hRes==ERROR_MORE_DATA) {
@@ -760,7 +760,7 @@
 
     if (hRes == ERROR_SUCCESS)
     {
-      /* 
+      /*
        * Convert the returned data to a displayable format
        */
       switch ( dwType )
@@ -783,25 +783,25 @@
           lpsRes = convertHexToHexCSV(lpbData, dwLen);
           break;
         }
-      } 
+      }
     }
 
     HeapFree(GetProcessHeap(), 0, lpbData);
   }
- 
- 
-  if ( hRes == ERROR_SUCCESS ) 
+
+
+  if ( hRes == ERROR_SUCCESS )
     printf(
-      "regapi: Value \"%s\" = \"%s\" in key [%s]\n", 
-      keyValue, 
+      "regapi: Value \"%s\" = \"%s\" in key [%s]\n",
+      keyValue,
       lpsRes,
       currentKeyName);
 
   else
     printf("regapi: ERROR Value \"%s\" not found. for key \"%s\"\n",
-      keyValue, 
+      keyValue,
       currentKeyName);
-    
+
   /*
    * Do some cleanup
    */
@@ -819,7 +819,7 @@
  */
 static void closeKey()
 {
-  RegCloseKey(currentKeyHandle); 
+  RegCloseKey(currentKeyHandle);
 
   HeapFree(GetProcessHeap(), 0, currentKeyName); /* Allocated by getKeyName */
 
@@ -831,119 +831,119 @@
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the setValue type of action.  It 
- * receives the currently read line and dispatch the work depending on the 
+ * This funtion is the main entry point to the setValue type of action.  It
+ * receives the currently read line and dispatch the work depending on the
  * context.
  */
 static void doSetValue(LPSTR stdInput)
 {
-  /* 
-   * We encoutered the end of the file, make sure we 
+  /*
+   * We encoutered the end of the file, make sure we
    * close the opened key and exit
-   */ 
-  if (stdInput == NULL)             
+   */
+  if (stdInput == NULL)
   {
-    if (bTheKeyIsOpen != FALSE) 
-      closeKey();                    
+    if (bTheKeyIsOpen != FALSE)
+      closeKey();
 
     return;
   }
-    
+
   if      ( stdInput[0] == '[')      /* We are reading a new key */
   {
-    if ( bTheKeyIsOpen != FALSE )      
+    if ( bTheKeyIsOpen != FALSE )
       closeKey();                    /* Close the previous key before */
 
     if ( openKey(stdInput) != ERROR_SUCCESS )
       printf ("regapi: doSetValue failed to open key %s\n", stdInput);
   }
-  else if( ( bTheKeyIsOpen ) && 
+  else if( ( bTheKeyIsOpen ) &&
            (( stdInput[0] == '@') || /* reading a default @=data pair */
             ( stdInput[0] == '\"'))) /* reading a new value=data pair */
   {
     processSetValue(stdInput);
   }
   else                               /* since we are assuming that the */
-  {                                  /* file format is valid we must   */ 
+  {                                  /* file format is valid we must   */
     if ( bTheKeyIsOpen )             /* be reading a blank line which  */
-      closeKey();                    /* indicate end of this key processing */ 
+      closeKey();                    /* indicate end of this key processing */
   }
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the queryValue type of action.  It 
- * receives the currently read line and dispatch the work depending on the 
+ * This funtion is the main entry point to the queryValue type of action.  It
+ * receives the currently read line and dispatch the work depending on the
  * context.
  */
-static void doQueryValue(LPSTR stdInput) { 
-  /* 
-   * We encoutered the end of the file, make sure we 
+static void doQueryValue(LPSTR stdInput) {
+  /*
+   * We encoutered the end of the file, make sure we
    * close the opened key and exit
-   */ 
-  if (stdInput == NULL)             
+   */
+  if (stdInput == NULL)
   {
-    if (bTheKeyIsOpen != FALSE) 
-      closeKey();                    
+    if (bTheKeyIsOpen != FALSE)
+      closeKey();
 
     return;
   }
-    
+
   if      ( stdInput[0] == '[')      /* We are reading a new key */
   {
-    if ( bTheKeyIsOpen != FALSE )      
+    if ( bTheKeyIsOpen != FALSE )
       closeKey();                    /* Close the previous key before */
 
     if ( openKey(stdInput) != ERROR_SUCCESS )
       printf ("regapi: doSetValue failed to open key %s\n", stdInput);
   }
-  else if( ( bTheKeyIsOpen ) && 
+  else if( ( bTheKeyIsOpen ) &&
            (( stdInput[0] == '@') || /* reading a default @=data pair */
             ( stdInput[0] == '\"'))) /* reading a new value=data pair */
   {
     processQueryValue(stdInput);
   }
   else                               /* since we are assuming that the */
-  {                                  /* file format is valid we must   */ 
+  {                                  /* file format is valid we must   */
     if ( bTheKeyIsOpen )             /* be reading a blank line which  */
-      closeKey();                    /* indicate end of this key processing */ 
+      closeKey();                    /* indicate end of this key processing */
   }
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the deletetValue type of action.  It 
- * receives the currently read line and dispatch the work depending on the 
+ * This funtion is the main entry point to the deletetValue type of action.  It
+ * receives the currently read line and dispatch the work depending on the
  * context.
  */
-static void doDeleteValue(LPSTR line) { 
+static void doDeleteValue(LPSTR line) {
   printf ("regapi: deleteValue not yet implemented\n");
 }
 /******************************************************************************
- * This funtion is the main entry point to the deleteKey type of action.  It 
- * receives the currently read line and dispatch the work depending on the 
+ * This funtion is the main entry point to the deleteKey type of action.  It
+ * receives the currently read line and dispatch the work depending on the
  * context.
  */
-static void doDeleteKey(LPSTR line)   { 
+static void doDeleteKey(LPSTR line)   {
   printf ("regapi: deleteKey not yet implemented\n");
 }
 /******************************************************************************
- * This funtion is the main entry point to the createKey type of action.  It 
- * receives the currently read line and dispatch the work depending on the 
+ * This funtion is the main entry point to the createKey type of action.  It
+ * receives the currently read line and dispatch the work depending on the
  * context.
  */
-static void doCreateKey(LPSTR line)   { 
+static void doCreateKey(LPSTR line)   {
   printf ("regapi: createKey not yet implemented\n");
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the registerDLL action.  It 
+ * This funtion is the main entry point to the registerDLL action.  It
  * receives the currently read line, then loads and registers the requested DLLs
  */
-static void doRegisterDLL(LPSTR stdInput) { 
+static void doRegisterDLL(LPSTR stdInput) {
   HMODULE theLib = 0;
   UINT retVal = 0;
 
   /* Check for valid input */
-  if (stdInput == NULL)             
+  if (stdInput == NULL)
     return;
 
   /* Load and register the library, then free it */
@@ -957,26 +957,26 @@
       printf("regapi: Couldn't find DllRegisterServer proc in '%s'.\n", stdInput);
 
     if (retVal != S_OK)
-      printf("regapi: DLLRegisterServer error 0x%x in '%s'.\n", retVal, stdInput);      
+      printf("regapi: DLLRegisterServer error 0x%x in '%s'.\n", retVal, stdInput);
 
     FreeLibrary(theLib);
   }
   else
   {
-    printf("regapi: Could not load DLL '%s'.\n", stdInput); 
+    printf("regapi: Could not load DLL '%s'.\n", stdInput);
   }
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the unregisterDLL action.  It 
+ * This funtion is the main entry point to the unregisterDLL action.  It
  * receives the currently read line, then loads and unregisters the requested DLLs
  */
-static void doUnregisterDLL(LPSTR stdInput) { 
+static void doUnregisterDLL(LPSTR stdInput) {
   HMODULE theLib = 0;
   UINT retVal = 0;
 
   /* Check for valid input */
-  if (stdInput == NULL)             
+  if (stdInput == NULL)
     return;
 
   /* Load and unregister the library, then free it */
@@ -990,13 +990,13 @@
       printf("regapi: Couldn't find DllUnregisterServer proc in '%s'.\n", stdInput);
 
     if (retVal != S_OK)
-      printf("regapi: DLLUnregisterServer error 0x%x in '%s'.\n", retVal, stdInput);      
+      printf("regapi: DLLUnregisterServer error 0x%x in '%s'.\n", retVal, stdInput);
 
     FreeLibrary(theLib);
   }
   else
   {
-    printf("regapi: Could not load DLL '%s'.\n", stdInput); 
+    printf("regapi: Could not load DLL '%s'.\n", stdInput);
   }
 }
 
@@ -1013,7 +1013,7 @@
   LPSTR nextLine        = NULL;
   ULONG  currentSize    = STDIN_MAX_LEN;
 
-  stdInput = HeapAlloc(GetProcessHeap(), 0, STDIN_MAX_LEN); 
+  stdInput = HeapAlloc(GetProcessHeap(), 0, STDIN_MAX_LEN);
   nextLine = HeapAlloc(GetProcessHeap(), 0, STDIN_MAX_LEN);
 
   if (stdInput == NULL || nextLine== NULL)
@@ -1021,9 +1021,9 @@
 
   /*
    * get the command, should be the first arg (modify cmdLine)
-   */ 
-  token = getToken(&cmdline, " "); 
-  if (token != NULL) 
+   */
+  token = getToken(&cmdline, " ");
+  if (token != NULL)
   {
     cmdIndex = getCommand(token);
     if (cmdIndex == COMMAND_NOT_FOUND)
@@ -1032,7 +1032,7 @@
       printf(helpText);
       return COMMAND_NOT_SUPPORTED;
     }
-  }    
+  }
   else
   {
     printf(
@@ -1041,8 +1041,8 @@
     return COMMAND_NOT_SUPPORTED;
   }
 
-  /* 
-   * check to see wether we force the action 
+  /*
+   * check to see wether we force the action
    * (meaning differs depending on the command performed)
    */
   if ( cmdline != NULL ) /* will be NULL if '-force' is not provided */
@@ -1053,18 +1053,18 @@
 
   while ( TRUE )
   {
-    /* 
+    /*
      * read a line
      */
       ULONG curSize=STDIN_MAX_LEN;
       char* s=NULL;
-   
+
       while((NULL!=(stdInput=fgets(stdInput,curSize,stdin))) && (NULL==(s=strchr(stdInput,'\n'))) ){
           fseek(stdin,-curSize,SEEK_CUR+1);
           stdInput=HeapReAlloc(GetProcessHeap(), 0,stdInput,curSize+=STDIN_MAX_LEN);
       }
-    /* 
-     * Make some handy generic stuff here... 
+    /*
+     * Make some handy generic stuff here...
      */
     if ( stdInput != NULL )
     {
@@ -1093,19 +1093,19 @@
 
     }
 
-    /* 
-     * We process every lines even the NULL (last) line, to indicate the 
+    /*
+     * We process every lines even the NULL (last) line, to indicate the
      * end of the processing to the specific process.
      */
-    commandAPIs[cmdIndex](stdInput);       
+    commandAPIs[cmdIndex](stdInput);
 
     if (stdInput == NULL)  /* EOF encountered */
       break;
   }
 
-#if 0 
-  /* 
-   * Save the registry only if it was modified 
+#if 0
+  /*
+   * Save the registry only if it was modified
    */
  if ( commandSaveRegistry[cmdIndex] != FALSE )
        SHELL_SaveRegistry();
diff --git a/programs/regedit/regedit.c b/programs/regedit/regedit.c
index 18fcc6c..8236044 100644
--- a/programs/regedit/regedit.c
+++ b/programs/regedit/regedit.c
@@ -84,18 +84,18 @@
     REGEDIT_ACTION action = ACTION_UNDEF;
     LPSTR s = lpCmdLine;        /* command line pointer */
     CHAR ch = *s;               /* current character */
-    
+
     setAppName("regedit");
     while (ch && ((ch == '-') || (ch == '/')))
     {
         char chu;
         char ch2;
-        
+
         s++;
         ch = *s;
         ch2 = *(s+1);
         chu = toupper(ch);
-        if (!ch2 || isspace(ch2)) 
+        if (!ch2 || isspace(ch2))
         {
             if (chu == 'S' || chu == 'V')
             {
diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c
index ad580d0..6153af0 100644
--- a/programs/regedit/regproc.c
+++ b/programs/regedit/regproc.c
@@ -32,7 +32,7 @@
 #define REG_VAL_BUF_SIZE        4096
 
 /* Delimiters used to parse the "value" to query queryValue*/
-#define QUERY_VALUE_MAX_ARGS  1 
+#define QUERY_VALUE_MAX_ARGS  1
 
 /* maximal number of characters in hexadecimal data line,
    not including '\' character */
@@ -184,7 +184,7 @@
 }
 
 /******************************************************************************
- * Converts a hex buffer into a hex comma separated values 
+ * Converts a hex buffer into a hex comma separated values
  */
 char* convertHexToHexCSV(BYTE *buf, ULONG bufLen)
 {
@@ -207,7 +207,7 @@
     sprintf(res, "%02x", (unsigned int)*&bCur);
     strcat(str, res);
     strcat(str, ",");
-  }                                   
+  }
 
   /* Get rid of the last comma */
   str[strlen(str)-1] = '\0';
@@ -267,14 +267,14 @@
     s+=3;
     strPos+=3;
     byteCount++;
-  }                                   
+  }
 
   return byteCount;
 }
 
 /******************************************************************************
- * This function returns the HKEY associated with the data type encoded in the 
- * value.  It modifies the input parameter (key value) in order to skip this 
+ * This function returns the HKEY associated with the data type encoded in the
+ * value.  It modifies the input parameter (key value) in order to skip this
  * "now useless" data type information.
  *
  * Note: Updated based on the algorithm used in 'server/registry.c'
@@ -324,7 +324,7 @@
 }
 
 /******************************************************************************
- * Returns an allocated buffer with a cleaned copy (removed the surrounding 
+ * Returns an allocated buffer with a cleaned copy (removed the surrounding
  * dbl quotes) of the passed value.
  */
 LPSTR getArg( LPSTR arg)
@@ -338,7 +338,7 @@
   /*
    * Get rid of surrounding quotes
    */
-  len = strlen(arg); 
+  len = strlen(arg);
 
   if( arg[len-1] == '\"' ) arg[len-1] = '\0';
   if( arg[0]     == '\"' ) arg++;
@@ -385,7 +385,7 @@
 }
 
 /******************************************************************************
- * Sets the value with name val_name to the data in val_data for the currently 
+ * Sets the value with name val_name to the data in val_data for the currently
  * opened key.
  *
  * Parameters:
@@ -417,7 +417,7 @@
     dwLen++;
     REGPROC_unescape_string(val_data);
     lpbData = val_data;
-  } 
+  }
   else if (dwParseType == REG_DWORD)  /* Convert the dword types */
   {
     dwLen   = convertHexToDWord(val_data, convert);
@@ -430,7 +430,7 @@
   }
 
   hRes = RegSetValueEx(
-          currentKeyHandle, 
+          currentKeyHandle,
           val_name,
           0,                  /* Reserved */
           dwDataType,
@@ -446,11 +446,11 @@
  */
 HRESULT openKey( LPSTR stdInput)
 {
-  DWORD   dwDisp;  
+  DWORD   dwDisp;
   HRESULT hRes;
 
   /* Sanity checks */
-  if (stdInput == NULL) 
+  if (stdInput == NULL)
     return ERROR_INVALID_PARAMETER;
 
   /* Get the registry class */
@@ -462,8 +462,8 @@
   currentKeyName = getRegKeyName(stdInput); /* Sets global variable */
   if (currentKeyName == NULL)
     return ERROR_INVALID_PARAMETER;
-    
-  hRes = RegCreateKeyEx( 
+
+  hRes = RegCreateKeyEx(
           currentKeyClass,          /* Class     */
           currentKeyName,           /* Sub Key   */
           0,                        /* MUST BE 0 */
@@ -486,11 +486,11 @@
  * Extracts from [HKEY\some\key\path] or HKEY\some\key\path types of line
  * the key name (what starts after the first '\')
  */
-LPSTR getRegKeyName(LPSTR lpLine) 
+LPSTR getRegKeyName(LPSTR lpLine)
 {
   LPSTR keyNameBeg;
   char  lpLineCopy[KEY_MAX_LEN];
-  
+
   if (lpLine == NULL)
     return NULL;
 
@@ -520,14 +520,14 @@
  * Extracts from [HKEY\some\key\path] or HKEY\some\key\path types of line
  * the key class (what ends before the first '\')
  */
-HKEY getRegClass(LPSTR lpClass) 
+HKEY getRegClass(LPSTR lpClass)
 {
   LPSTR classNameEnd;
   LPSTR classNameBeg;
   int i;
-  
+
   char  lpClassCopy[KEY_MAX_LEN];
-  
+
   if (lpClass == NULL)
     return (HKEY)ERROR_INVALID_PARAMETER;
 
@@ -550,7 +550,7 @@
       classNameBeg = lpClassCopy;
   }
 
-  for (i = 0; i < REG_CLASS_NUMBER; i++) 
+  for (i = 0; i < REG_CLASS_NUMBER; i++)
   {
       if (!strcmp(classNameBeg, reg_class_names[i]))
       {
@@ -565,7 +565,7 @@
  */
 void closeKey()
 {
-  RegCloseKey(currentKeyHandle); 
+  RegCloseKey(currentKeyHandle);
 
   HeapFree(GetProcessHeap(), 0, currentKeyName); /* Allocated by getKeyName */
 
@@ -577,113 +577,113 @@
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the setValue type of action.  It 
- * receives the currently read line and dispatch the work depending on the 
+ * This funtion is the main entry point to the setValue type of action.  It
+ * receives the currently read line and dispatch the work depending on the
  * context.
  */
 void doSetValue(LPSTR stdInput)
 {
-  /* 
-   * We encoutered the end of the file, make sure we 
+  /*
+   * We encoutered the end of the file, make sure we
    * close the opened key and exit
-   */ 
-  if (stdInput == NULL)             
+   */
+  if (stdInput == NULL)
   {
-    if (bTheKeyIsOpen != FALSE) 
-      closeKey();                    
+    if (bTheKeyIsOpen != FALSE)
+      closeKey();
 
     return;
   }
-    
+
   if      ( stdInput[0] == '[')      /* We are reading a new key */
   {
-    if ( bTheKeyIsOpen != FALSE )      
+    if ( bTheKeyIsOpen != FALSE )
       closeKey();                    /* Close the previous key before */
 
     if ( openKey(stdInput) != ERROR_SUCCESS )
       printf ("%s: doSetValue failed to open key %s\n", getAppName(), stdInput);
   }
-  else if( ( bTheKeyIsOpen ) && 
+  else if( ( bTheKeyIsOpen ) &&
            (( stdInput[0] == '@') || /* reading a default @=data pair */
             ( stdInput[0] == '\"'))) /* reading a new value=data pair */
   {
     processSetValue(stdInput);
   }
   else                               /* since we are assuming that the */
-  {                                  /* file format is valid we must   */ 
+  {                                  /* file format is valid we must   */
     if ( bTheKeyIsOpen )             /* be reading a blank line which  */
-      closeKey();                    /* indicate end of this key processing */ 
+      closeKey();                    /* indicate end of this key processing */
   }
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the queryValue type of action.  It 
- * receives the currently read line and dispatch the work depending on the 
+ * This funtion is the main entry point to the queryValue type of action.  It
+ * receives the currently read line and dispatch the work depending on the
  * context.
  */
-void doQueryValue(LPSTR stdInput) { 
-  /* 
-   * We encoutered the end of the file, make sure we 
+void doQueryValue(LPSTR stdInput) {
+  /*
+   * We encoutered the end of the file, make sure we
    * close the opened key and exit
-   */ 
-  if (stdInput == NULL)             
+   */
+  if (stdInput == NULL)
   {
-    if (bTheKeyIsOpen != FALSE) 
-      closeKey();                    
+    if (bTheKeyIsOpen != FALSE)
+      closeKey();
 
     return;
   }
-    
+
   if      ( stdInput[0] == '[')      /* We are reading a new key */
   {
-    if ( bTheKeyIsOpen != FALSE )      
+    if ( bTheKeyIsOpen != FALSE )
       closeKey();                    /* Close the previous key before */
 
     if ( openKey(stdInput) != ERROR_SUCCESS )
       printf ("%s: doSetValue failed to open key %s\n", getAppName(), stdInput);
   }
-  else if( ( bTheKeyIsOpen ) && 
+  else if( ( bTheKeyIsOpen ) &&
            (( stdInput[0] == '@') || /* reading a default @=data pair */
             ( stdInput[0] == '\"'))) /* reading a new value=data pair */
   {
     processQueryValue(stdInput);
   }
   else                               /* since we are assuming that the */
-  {                                  /* file format is valid we must   */ 
+  {                                  /* file format is valid we must   */
     if ( bTheKeyIsOpen )             /* be reading a blank line which  */
-      closeKey();                    /* indicate end of this key processing */ 
+      closeKey();                    /* indicate end of this key processing */
   }
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the deletetValue type of action.  It 
- * receives the currently read line and dispatch the work depending on the 
+ * This funtion is the main entry point to the deletetValue type of action.  It
+ * receives the currently read line and dispatch the work depending on the
  * context.
  */
-void doDeleteValue(LPSTR line) { 
+void doDeleteValue(LPSTR line) {
   printf ("%s: deleteValue not yet implemented\n", getAppName());
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the deleteKey type of action.  It 
- * receives the currently read line and dispatch the work depending on the 
+ * This funtion is the main entry point to the deleteKey type of action.  It
+ * receives the currently read line and dispatch the work depending on the
  * context.
  */
-void doDeleteKey(LPSTR line)   { 
+void doDeleteKey(LPSTR line)   {
   printf ("%s: deleteKey not yet implemented\n", getAppName());
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the createKey type of action.  It 
- * receives the currently read line and dispatch the work depending on the 
+ * This funtion is the main entry point to the createKey type of action.  It
+ * receives the currently read line and dispatch the work depending on the
  * context.
  */
-void doCreateKey(LPSTR line)   { 
+void doCreateKey(LPSTR line)   {
   printf ("%s: createKey not yet implemented\n", getAppName());
 }
 
 /******************************************************************************
- * This function is a wrapper for the setValue function.  It prepares the 
+ * This function is a wrapper for the setValue function.  It prepares the
  * land and clean the area once completed.
  * Note: this function modifies the line parameter.
  *
@@ -733,7 +733,7 @@
       }
 
   }
-  else 
+  else
   {
       printf("Warning! uncrecognized line:\n%s\n", line);
       return;
@@ -747,12 +747,12 @@
     printf("%s: ERROR Key %s not created. Value: %s, Data: %s\n",
            getAppName(),
            currentKeyName,
-           val_name, 
+           val_name,
            val_data);
 }
 
 /******************************************************************************
- * This function is a wrapper for the queryValue function.  It prepares the 
+ * This function is a wrapper for the queryValue function.  It prepares the
  * land and clean the area once completed.
  */
 void processQueryValue(LPSTR cmdline)
@@ -774,7 +774,7 @@
   for (counter=0; counter<QUERY_VALUE_MAX_ARGS; counter++)
     argv[counter]=NULL;
 
-  while( (token = getToken(&cmdline, queryValueDelim[argCounter])) != NULL ) 
+  while( (token = getToken(&cmdline, queryValueDelim[argCounter])) != NULL )
   {
     argv[argCounter++] = getArg(token);
 
@@ -786,18 +786,18 @@
   if ( argv[0] == NULL )
     return; /* SHOULD NOT HAPPEN */
   else
-    keyValue = argv[0]; 
+    keyValue = argv[0];
 
-  if( (keyValue[0] == '@') && (strlen(keyValue) == 1) ) 
+  if( (keyValue[0] == '@') && (strlen(keyValue) == 1) )
   {
     LONG  lLen  = KEY_MAX_LEN;
     CHAR*  lpsData=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,KEY_MAX_LEN);
-    /* 
+    /*
      * We need to query the key default value
      */
     hRes = RegQueryValue(
-             currentKeyHandle, 
-             currentKeyName, 
+             currentKeyHandle,
+             currentKeyName,
              (LPBYTE)lpsData,
              &lLen);
 
@@ -813,20 +813,20 @@
       lpsRes[lLen-1]='\0';
     }
   }
-  else 
+  else
   {
     DWORD  dwLen  = KEY_MAX_LEN;
     BYTE*  lpbData=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,KEY_MAX_LEN);
     DWORD  dwType;
-    /* 
+    /*
      * We need to query a specific value for the key
      */
     hRes = RegQueryValueEx(
-             currentKeyHandle, 
-             keyValue, 
-             0, 
-             &dwType, 
-             (LPBYTE)lpbData, 
+             currentKeyHandle,
+             keyValue,
+             0,
+             &dwType,
+             (LPBYTE)lpbData,
              &dwLen);
 
     if (hRes==ERROR_MORE_DATA) {
@@ -836,7 +836,7 @@
 
     if (hRes == ERROR_SUCCESS)
     {
-      /* 
+      /*
        * Convert the returned data to a displayable format
        */
       switch ( dwType )
@@ -859,27 +859,27 @@
           lpsRes = convertHexToHexCSV(lpbData, dwLen);
           break;
         }
-      } 
+      }
     }
 
     HeapFree(GetProcessHeap(), 0, lpbData);
   }
- 
- 
-  if ( hRes == ERROR_SUCCESS ) 
+
+
+  if ( hRes == ERROR_SUCCESS )
     printf(
       "%s: Value \"%s\" = \"%s\" in key [%s]\n",
       getAppName(),
-      keyValue, 
+      keyValue,
       lpsRes,
       currentKeyName);
 
   else
     printf("%s: ERROR Value \"%s\" not found. for key \"%s\"\n",
       getAppName(),
-      keyValue, 
+      keyValue,
       currentKeyName);
-    
+
   /*
    * Do some cleanup
    */
@@ -909,7 +909,7 @@
     {
         LPSTR readRes   = "";       /* result of the last read */
         ULONG curLen    = 0;        /* length of a read string */
-        while ( readRes ) 
+        while ( readRes )
         {
             if (strchr(*pLine, '\n'))
             {
@@ -944,7 +944,7 @@
     ULONG lineSize       = REG_VAL_BUF_SIZE;
     ULONG nextLineSize   = REG_VAL_BUF_SIZE;
 
-    line = HeapAlloc(GetProcessHeap(), 0, lineSize); 
+    line = HeapAlloc(GetProcessHeap(), 0, lineSize);
     nextLine = HeapAlloc(GetProcessHeap(), 0, nextLineSize);
 
     if (!line || !nextLine)
@@ -957,10 +957,10 @@
     while (!feof(in))
     {
         ULONG curLen;
-        
+
         readLine(in, &line, &lineSize);
         curLen = strlen(line);
-        
+
         if ( curLen )
         {
             if( line[0] == '#' )    /* this is a comment */
@@ -983,9 +983,9 @@
     }
     command(NULL);
 
-#if 0 
-    /* 
-     * Save the registry only if it was modified 
+#if 0
+    /*
+     * Save the registry only if it was modified
      */
     if ( commandSaveRegistry[cmdIndex] )
         SHELL_SaveRegistry();
@@ -995,15 +995,15 @@
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the registerDLL action.  It 
+ * This funtion is the main entry point to the registerDLL action.  It
  * receives the currently read line, then loads and registers the requested DLLs
  */
-void doRegisterDLL(LPSTR stdInput) { 
+void doRegisterDLL(LPSTR stdInput) {
   HMODULE theLib = 0;
   UINT retVal = 0;
 
   /* Check for valid input */
-  if (stdInput == NULL)             
+  if (stdInput == NULL)
     return;
 
   /* Load and register the library, then free it */
@@ -1019,26 +1019,26 @@
 
     if (retVal != S_OK)
       printf("%s: DLLRegisterServer error 0x%x in '%s'.\n",
-             getAppName(), retVal, stdInput);      
+             getAppName(), retVal, stdInput);
 
     FreeLibrary(theLib);
   }
   else
   {
-    printf("%s: Could not load DLL '%s'.\n", getAppName(), stdInput); 
+    printf("%s: Could not load DLL '%s'.\n", getAppName(), stdInput);
   }
 }
 
 /******************************************************************************
- * This funtion is the main entry point to the unregisterDLL action.  It 
+ * This funtion is the main entry point to the unregisterDLL action.  It
  * receives the currently read line, then loads and unregisters the requested DLLs
  */
-void doUnregisterDLL(LPSTR stdInput) { 
+void doUnregisterDLL(LPSTR stdInput) {
   HMODULE theLib = 0;
   UINT retVal = 0;
 
   /* Check for valid input */
-  if (stdInput == NULL)             
+  if (stdInput == NULL)
     return;
 
   /* Load and unregister the library, then free it */
@@ -1222,7 +1222,7 @@
             } else {
                 fputs("@=", file);
             }
-            
+
             switch (value_type)
             {
             case REG_SZ:
@@ -1270,7 +1270,7 @@
             }
         }
     }
-    
+
     /*fputs("\n", file);*/
 
     i = 0;
@@ -1397,7 +1397,7 @@
 
         /* export all registry classes */
         file = REGPROC_open_export_file(file_name);
-        for (i = 0; i < REG_CLASS_NUMBER; i++) 
+        for (i = 0; i < REG_CLASS_NUMBER; i++)
         {
             strcpy(reg_key_name_buf, reg_class_names[i]);
             export_hkey(file, reg_class_keys[i],
@@ -1416,7 +1416,7 @@
 }
 
 /******************************************************************************
- * Recursive function which removes the registry key with all subkeys. 
+ * Recursive function which removes the registry key with all subkeys.
  */
 void delete_branch(HKEY key,
                    CHAR **reg_key_name_buf, DWORD *reg_key_name_len)
diff --git a/programs/regedit/regproc.h b/programs/regedit/regproc.h
index 7ee198e..ab54fae 100644
--- a/programs/regedit/regproc.h
+++ b/programs/regedit/regproc.h
@@ -20,7 +20,7 @@
 /******************************************************************************
  * Defines and consts
  */
-#define KEY_MAX_LEN             1024 
+#define KEY_MAX_LEN             1024
 
 /* Return values */
 #define SUCCESS               0
@@ -44,7 +44,7 @@
 
 void processRegLines(FILE *in, CommandAPI command);
 
-/* 
+/*
  * Generic prototypes
  */
 char*   getToken(char** str, const char* delims);
@@ -60,13 +60,13 @@
 HRESULT openKey(LPSTR stdInput);
 void    closeKey();
 
-/* 
+/*
  * api setValue prototypes
  */
 void    processSetValue(LPSTR cmdline);
 HRESULT setValue(LPSTR val_name, LPSTR val_data);
 
-/* 
+/*
  * api queryValue prototypes
  */
 void    processQueryValue(LPSTR cmdline);
diff --git a/programs/regsvr32/regsvr32.c b/programs/regsvr32/regsvr32.c
index 587e6fb..5908641 100644
--- a/programs/regsvr32/regsvr32.c
+++ b/programs/regsvr32/regsvr32.c
@@ -136,7 +136,7 @@
     return 0;
 }
 
-int InstallDll(BOOL install, char *strDll, WCHAR *command_line) 
+int InstallDll(BOOL install, char *strDll, WCHAR *command_line)
 {
     HRESULT hr;
     DLLINSTALL pfInstall;
@@ -169,7 +169,7 @@
     BOOL            DllFound = FALSE;
     WCHAR*          wsCommandLine = NULL;
     WCHAR           EmptyLine[1] = {0};
-    
+
 
     for(i = 1; i < argc; i++)
     {
@@ -180,9 +180,9 @@
         else if (!strnicmp(argv[i], "/i", strlen("/i")))
         {
             CHAR* command_line = argv[i] + strlen("/i");
-            
+
             CallInstall = TRUE;
-            if (command_line[0] == ':' && command_line[1]) 
+            if (command_line[0] == ':' && command_line[1])
             {
                 int len = strlen(command_line);
 
@@ -214,7 +214,7 @@
                     wsCommandLine = EmptyLine;
                 }
             }
-            else 
+            else
             {
                 wsCommandLine = EmptyLine;
             }
@@ -236,7 +236,7 @@
                 else
                     res = RegisterDll(DllName);
             }
-            
+
             if (res)
                 return res;
 
@@ -244,7 +244,7 @@
             {
                 res = InstallDll(!Unregister, DllName, wsCommandLine);
             }
-            
+
             return res;
         }
     }
diff --git a/programs/regtest/regtest.c b/programs/regtest/regtest.c
index 30accb1..fb9b72a 100644
--- a/programs/regtest/regtest.c
+++ b/programs/regtest/regtest.c
@@ -152,13 +152,13 @@
     char keyname[]="regtest1";
 
     lSts = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE",0,1,&hkeyP);
-    if (lSts != ERROR_SUCCESS) 
+    if (lSts != ERROR_SUCCESS)
       {
 	xERROR(1,lSts);
 	return;
       }
     lSts = RegCreateKeyEx(hkeyP,keyname,0,0,0,0xf003f,0,&hkey,&dwDisp);
-    if (lSts != ERROR_SUCCESS) 
+    if (lSts != ERROR_SUCCESS)
     {
       xERROR(2,lSts);
       RegCloseKey(hkeyP);
diff --git a/programs/uninstaller/main.c b/programs/uninstaller/main.c
index 560ea24..69873bd 100644
--- a/programs/uninstaller/main.c
+++ b/programs/uninstaller/main.c
@@ -1,6 +1,6 @@
 /*
  * Q&D Uninstaller (main.c)
- * 
+ *
  * Copyright 2000 Andreas Mohr <andi@lisas.de>
  *
  * This library is free software; you can redistribute it and/or
@@ -42,7 +42,7 @@
 #include <stdio.h>
 #define DEBUG(x...) fprintf(stderr,x)
 #else
-#define DEBUG(x...) 
+#define DEBUG(x...)
 #endif
 
 /* use multi-select listbox */
@@ -93,7 +93,7 @@
 void ListUninstallPrograms(void)
 {
     int i;
-    
+
     if (! FetchUninstallInformation())
         return;
 
@@ -128,7 +128,7 @@
 
 
 int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow )
-{ 
+{
     MSG msg;
     WNDCLASS wc;
     HWND hWnd;
@@ -165,15 +165,15 @@
     wc.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH );
     wc.lpszMenuName = NULL;
     wc.lpszClassName = appname;
-    
+
     if (!RegisterClass(&wc)) exit(1);
-    hWnd = CreateWindow( appname, appname, 
-        WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX, 
-        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 
+    hWnd = CreateWindow( appname, appname,
+        WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX,
+        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
         NULL_HANDLE, NULL_HANDLE, hInst, NULL );
-    
+
     if (!hWnd) exit(1);
-    
+
     ShowWindow( hWnd, cmdshow );
     UpdateWindow( hWnd );
 
@@ -198,7 +198,7 @@
     char key_app[1024];
     char *p;
 
-    
+
     numentries = 0;
     oldsel = -1;
     if ( RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_UNINSTALL,
@@ -207,7 +207,7 @@
 	MessageBox(0, "Uninstall registry key not available (yet), nothing to do !", appname, MB_OK);
 	return 0;
     }
-	
+
     strcpy(key_app, REGSTR_PATH_UNINSTALL);
     strcat(key_app, "\\");
     p = key_app+strlen(REGSTR_PATH_UNINSTALL)+1;
@@ -324,7 +324,7 @@
 		cxChar * 50 + GetSystemMetrics(SM_CXVSCROLL), cyChar * 20,
 		hWnd, (HMENU) 1,
 		(HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE), NULL);
-	
+
 	GetWindowRect(hwndList, &rect);
 	y = by;
 	maxx += (rect.right - rect.left)*1.1;
@@ -402,14 +402,14 @@
     case WM_DESTROY:
         PostQuitMessage( 0 );
         return 0;
-    
+
     case WM_COMMAND:
 	if ((HWND)lParam == hwndList)
 	{
 	    if (HIWORD(wParam) == LBN_SELCHANGE)
 	    {
 		int sel = SendMessage(hwndList, LB_GETCURSEL, 0, 0);
-		
+
 #ifndef USE_MULTIPLESEL
 		if (oldsel != -1)
 		{
@@ -427,7 +427,7 @@
 	if ((HWND)lParam == button[0].hwnd) /* Uninstall button */
         {
 	    UninstallProgram();
-   
+
 	    InvalidateRect(hWnd, NULL, TRUE);
 	    UpdateWindow(hWnd);
 
@@ -440,6 +440,6 @@
 	    PostQuitMessage(0);
 	return 0;
     }
-	
+
     return( DefWindowProc( hWnd, msg, wParam, lParam ));
 }
diff --git a/programs/view/globals.h b/programs/view/globals.h
index 17edfc7..eeee749 100644
--- a/programs/view/globals.h
+++ b/programs/view/globals.h
@@ -17,8 +17,8 @@
  */
 
 /* for SMALL_RECT */
-#include "wincon.h" 
-#include "resource.h" 
+#include "wincon.h"
+#include "resource.h"
 
 /*  Add global function prototypes here */
 
diff --git a/programs/view/init.c b/programs/view/init.c
index 92585e5..15cdfa7 100644
--- a/programs/view/init.c
+++ b/programs/view/init.c
@@ -31,7 +31,7 @@
   WNDCLASSEX wc;
 
   /* Load the application name and description strings */
-  
+
   LoadString(hInstance, IDS_APPNAME, szAppName, sizeof(szAppName));
   LoadString(hInstance, IDS_DESCRIPTION, szTitle, sizeof(szTitle));
 
@@ -41,7 +41,7 @@
   wc.cbSize = sizeof(WNDCLASSEX);
 
   /* Load small icon image */
-  wc.hIconSm = LoadImage(hInstance,		
+  wc.hIconSm = LoadImage(hInstance,
 			 MAKEINTRESOURCEA(IDI_APPICON),
 			 IMAGE_ICON,
 			 16, 16,
@@ -73,7 +73,7 @@
 
 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 {
-    HWND hwnd; 
+    HWND hwnd;
 
     /* Save the instance handle in a global variable for later use */
     hInst = hInstance;
@@ -86,9 +86,9 @@
                         CW_USEDEFAULT, 0,    /* size */
                         NULL,                /* Overlapped has no parent */
                         NULL,                /* Use the window class menu */
-                        hInstance,           
-                        NULL);               
-    
+                        hInstance,
+                        NULL);
+
     if (!hwnd)
         return FALSE;
 
diff --git a/programs/view/view.c b/programs/view/view.c
index d8c5fc8..b42bcee 100644
--- a/programs/view/view.c
+++ b/programs/view/view.c
@@ -19,7 +19,7 @@
 #include <windows.h>
 #include "resource.h"
 
-/* 
+/*
 #include <windowsx.h>
    Wine doesn't have windowsx.h, so we use this
 */
@@ -28,7 +28,7 @@
 /* Wine seems to need this */
 #include <commdlg.h>
 
-#include "globals.h"        
+#include "globals.h"
 #include <stdio.h>
 
 BOOL FileIsPlaceable( LPCSTR szFileName );
@@ -44,7 +44,7 @@
 BOOL FileOpen(HWND hWnd, char *fn)
 {
   OPENFILENAME ofn = { sizeof(OPENFILENAME),
-		       0, 0, NULL, NULL, 0, 0, NULL, 
+		       0, 0, NULL, NULL, 0, 0, NULL,
 		       FN_LENGTH, NULL, 0, NULL, NULL, OFN_CREATEPROMPT |
 		       OFN_SHOWHELP, 0, 0, NULL, 0, NULL };
   ofn.lpstrFilter = "Metafiles\0*.wmf\0";
@@ -61,9 +61,9 @@
 {
   switch (uMessage)
     {
-    case WM_PAINT: 
+    case WM_PAINT:
       {
-	PAINTSTRUCT ps; 
+	PAINTSTRUCT ps;
 	BeginPaint(hwnd, &ps);
 	SetMapMode(ps.hdc, MM_ANISOTROPIC);
 	SetViewportExtEx(ps.hdc, width, height, NULL);
@@ -99,7 +99,7 @@
 	    }
 	  }
 	  break;
-	  
+
 	case IDM_SET_EXT_TO_WIN:
 	  {
 	    RECT r;
@@ -110,7 +110,7 @@
 	  }
 	  break;
 
-	  
+
 	case IDM_LEFT:
 	  deltax += 100;
 	  InvalidateRect( hwnd, NULL, TRUE );
@@ -155,7 +155,7 @@
   if( (hInFile = _lopen( szFileName, OF_READ ) ) == HFILE_ERROR )
     return FALSE;
 
-  if( _lread( hInFile, &apmh, sizeof(APMFILEHEADER) ) 
+  if( _lread( hInFile, &apmh, sizeof(APMFILEHEADER) )
       != sizeof(APMFILEHEADER) )
     {
       _lclose( hInFile );
@@ -184,11 +184,11 @@
   checksum = 0;
   p = (WORD *) &APMHeader;
 
-  for(i=0; i<10; i++) 
+  for(i=0; i<10; i++)
     checksum ^= *p++;
   if (checksum != APMHeader.checksum) {
     char msg[128];
-    sprintf(msg, "Computed checksum %04x != stored checksum %04x\n", 
+    sprintf(msg, "Computed checksum %04x != stored checksum %04x\n",
 	   checksum, APMHeader.checksum);
         MessageBox(hwnd, msg, "Checksum failed", MB_OK);
     return 0;
@@ -207,10 +207,10 @@
   }
   _lclose(fh);
 
-  if (!(hmf = SetMetaFileBitsEx(mfHeader.mtSize*2, lpData))) 
+  if (!(hmf = SetMetaFileBitsEx(mfHeader.mtSize*2, lpData)))
     return 0;
 
-  
+
   width = APMHeader.bbox.Right - APMHeader.bbox.Left;
   height = APMHeader.bbox.Bottom - APMHeader.bbox.Top;
 
diff --git a/programs/view/winmain.c b/programs/view/winmain.c
index 7024c6d..1dba678 100644
--- a/programs/view/winmain.c
+++ b/programs/view/winmain.c
@@ -16,25 +16,25 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <windows.h>            /* required for all Windows applications */ 
+#include <windows.h>            /* required for all Windows applications */
 #include "globals.h"            /* prototypes specific to this application */
 
 
 int APIENTRY WinMain(HINSTANCE hInstance,
-                     HINSTANCE hPrevInstance, 
-                     LPSTR     lpCmdLine, 
+                     HINSTANCE hPrevInstance,
+                     LPSTR     lpCmdLine,
                      int       nCmdShow)
 {
     MSG msg;
     HANDLE hAccelTable;
-    
+
     /* Other instances of app running? */
     if (!hPrevInstance)
     {
       /* stuff to be done once */
       if (!InitApplication(hInstance))
       {
-	return FALSE;              /* exit */ 
+	return FALSE;              /* exit */
       }
     }
 
@@ -56,7 +56,7 @@
       if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
         {
             TranslateMessage(&msg);
-            DispatchMessage(&msg); 
+            DispatchMessage(&msg);
         }
     }
 
diff --git a/programs/wcmd/batch.c b/programs/wcmd/batch.c
index b73e3ef..c925251 100644
--- a/programs/wcmd/batch.c
+++ b/programs/wcmd/batch.c
@@ -112,8 +112,8 @@
 char *p, *s, *t;
 int i;
 
-  /* Get working version of command line */                  
-  strcpy(cmd1, line);                                    
+  /* Get working version of command line */
+  strcpy(cmd1, line);
 
   /* Expand environment variables in a batch file %{0-9} first  */
   /*   Then env vars, and if any left (ie use of undefined vars,*/
@@ -122,8 +122,8 @@
   /*   contents of fred, then the digit 1. Would need to remove */
   /*   ExpandEnvStrings to achieve this                         */
 
-  /* Replace use of %0...%9 */                                
-  p = cmd1;                                                   
+  /* Replace use of %0...%9 */
+  p = cmd1;
   while ((p = strchr(p, '%'))) {
     i = *(p+1) - '0';
     if ((i >= 0) && (i <= 9)) {
@@ -132,8 +132,8 @@
       strcpy (p, t);
       strcat (p, s);
       free (s);
-    } else {                                                  
-      p++;                                                    
+    } else {
+      p++;
     }
   }
 
@@ -146,25 +146,25 @@
 
   /* In a batch program, unknown variables are replace by nothing */
   /* so remove any remaining %var%                                */
-  p = cmd2;                                                   
-  while ((p = strchr(p, '%'))) {                              
-    s = strchr(p+1, '%');                                     
-    if (!s) {                                                 
-      *p=0x00;                                                
-    } else {                                                  
-      t = strdup(s+1);                                        
-      strcpy(p, t);                                           
-      free(t);                                                
-    }                                                         
-  }                                                           
+  p = cmd2;
+  while ((p = strchr(p, '%'))) {
+    s = strchr(p+1, '%');
+    if (!s) {
+      *p=0x00;
+    } else {
+      t = strdup(s+1);
+      strcpy(p, t);
+      free(t);
+    }
+  }
 
   /* Show prompt before batch line IF echo is on */
-  if (echo_mode && (line[0] != '@')) {                        
-    WCMD_show_prompt();                                       
-    WCMD_output ("%s\n", cmd2);                               
-  }                                                           
+  if (echo_mode && (line[0] != '@')) {
+    WCMD_show_prompt();
+    WCMD_output ("%s\n", cmd2);
+  }
 
-  WCMD_process_command (cmd2);                             
+  WCMD_process_command (cmd2);
 }
 
 /*******************************************************************
diff --git a/programs/wcmd/builtins.c b/programs/wcmd/builtins.c
index ee15396..95e81cc 100644
--- a/programs/wcmd/builtins.c
+++ b/programs/wcmd/builtins.c
@@ -227,7 +227,7 @@
     echo_mode = 0;
     return;
   }
-  WCMD_output_asis (command);    
+  WCMD_output_asis (command);
   WCMD_output (newline);
 
 }
@@ -628,7 +628,7 @@
 LPVOID env;
 char *p;
 int status;
-char buffer[1048];                                                   
+char buffer[1048];
 
   if (strlen(param1) == 0) {
     env = GetEnvironmentStrings ();
@@ -642,22 +642,22 @@
     p = strchr (s, '=');
     if (p == NULL) {
 
-      /* FIXME: Emulate Win98 for now, ie "SET C" looks ONLY for an    
-         environment variable C, whereas on NT it shows ALL variables  
-         starting with C.                                              
-       */                                                            
-      status = GetEnvironmentVariable(s, buffer, sizeof(buffer));    
-      if (status) {                                                  
-        WCMD_output("%s=%s\n", s, buffer);                           
-      } else {                                                       
-        WCMD_output ("Environment variable %s not defined\n", s);    
-      }                                                              
+      /* FIXME: Emulate Win98 for now, ie "SET C" looks ONLY for an
+         environment variable C, whereas on NT it shows ALL variables
+         starting with C.
+       */
+      status = GetEnvironmentVariable(s, buffer, sizeof(buffer));
+      if (status) {
+        WCMD_output("%s=%s\n", s, buffer);
+      } else {
+        WCMD_output ("Environment variable %s not defined\n", s);
+      }
       return;
     }
     *p++ = '\0';
 
-    if (strlen(p) == 0) p = 0x00;                                    
-    status = SetEnvironmentVariable (s, p);   
+    if (strlen(p) == 0) p = 0x00;
+    status = SetEnvironmentVariable (s, p);
     if (!status) WCMD_print_error();
   }
   /* WCMD_output (newline);   @JED*/
diff --git a/programs/wcmd/directory.c b/programs/wcmd/directory.c
index 317df7b..2a1faff 100644
--- a/programs/wcmd/directory.c
+++ b/programs/wcmd/directory.c
@@ -41,7 +41,7 @@
 extern char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH];
 extern DWORD errorlevel;
 
-int file_total, dir_total, line_count, page_mode, recurse, wide, bare, 
+int file_total, dir_total, line_count, page_mode, recurse, wide, bare,
     max_width;
 __int64 byte_total;
 
@@ -100,7 +100,7 @@
      if (recurse) {
        WCMD_output ("\n\n     Total files listed:\n%8d files%25s bytes\n",
             file_total, WCMD_filesize64 (byte_total));
-       WCMD_output ("%8d directories %18s bytes free\n\n", 
+       WCMD_output ("%8d directories %18s bytes free\n\n",
             dir_total, WCMD_filesize64 (free.QuadPart));
      } else {
        WCMD_output (" %18s bytes free\n\n", WCMD_filesize64 (free.QuadPart));
@@ -117,7 +117,7 @@
  * FIXME: Entries sorted by name only. Should we support DIRCMD??
  * FIXME: Assumes 24-line display for the /P qualifier.
  * FIXME: Other command qualifiers not supported.
- * FIXME: DIR /S FILENAME fails if at least one matching file is not found in the top level. 
+ * FIXME: DIR /S FILENAME fails if at least one matching file is not found in the top level.
  */
 
 void WCMD_list_directory (char *search_path, int level) {
@@ -258,7 +258,7 @@
       	     datestring, timestring, (fd+i)->cFileName);
          linesout++;
       } else {
-         if (!((strcmp((fd+i)->cFileName, ".") == 0) || 
+         if (!((strcmp((fd+i)->cFileName, ".") == 0) ||
                (strcmp((fd+i)->cFileName, "..") == 0))) {
             WCMD_output ("%s%s\n", recurse?real_path:"", (fd+i)->cFileName);
             linesout++;
diff --git a/programs/wcmd/wcmd.h b/programs/wcmd/wcmd.h
index 7ce15e3..8f0e29a 100644
--- a/programs/wcmd/wcmd.h
+++ b/programs/wcmd/wcmd.h
@@ -1,5 +1,5 @@
 /*
- * WCMD - Wine-compatible command line interface. 
+ * WCMD - Wine-compatible command line interface.
  *
  * Copyright (C) 1999 D A Pickles
  *
@@ -46,7 +46,7 @@
 void WCMD_if (char *);
 void WCMD_move (void);
 void WCMD_output (char *format, ...);
-void WCMD_output_asis (char *message);                   
+void WCMD_output_asis (char *message);
 void WCMD_parse (char *s, char *q, char *p1, char *p2);
 void WCMD_pause (void);
 void WCMD_pipe (char *command);
diff --git a/programs/wcmd/wcmdmain.c b/programs/wcmd/wcmdmain.c
index 1bb1043..a4b6539 100644
--- a/programs/wcmd/wcmdmain.c
+++ b/programs/wcmd/wcmdmain.c
@@ -1,5 +1,5 @@
 /*
- * WCMD - Wine-compatible command line interface. 
+ * WCMD - Wine-compatible command line interface.
  *
  * Copyright (C) 1999 - 2001 D A Pickles
  *
@@ -198,11 +198,11 @@
     }
     if ((p = strchr(cmd,'<')) != NULL) *p = '\0';
 
-/*                                                               
- * Strip leading whitespaces, and a '@' if supplied              
- */                                                            
-    whichcmd = WCMD_strtrim_leading_spaces(cmd);               
-    if (whichcmd[0] == '@') whichcmd++;                        
+/*
+ * Strip leading whitespaces, and a '@' if supplied
+ */
+    whichcmd = WCMD_strtrim_leading_spaces(cmd);
+    if (whichcmd[0] == '@') whichcmd++;
 
 /*
  *	Check if the command entered is internal. If it is, pass the rest of the
@@ -210,14 +210,14 @@
  */
 
     count = 0;
-    while (IsCharAlphaNumeric(whichcmd[count])) {              
+    while (IsCharAlphaNumeric(whichcmd[count])) {
       count++;
     }
     for (i=0; i<=WCMD_EXIT; i++) {
       if (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT,
-      	  whichcmd, count, inbuilt[i], -1) == 2) break;        
+      	  whichcmd, count, inbuilt[i], -1) == 2) break;
     }
-    p = WCMD_strtrim_leading_spaces (&whichcmd[count]);       
+    p = WCMD_strtrim_leading_spaces (&whichcmd[count]);
     WCMD_parse (p, quals, param1, param2);
     switch (i) {
 
@@ -253,11 +253,11 @@
       case WCMD_ECHO:
         /* Use the unstripped version of the following data - step over the space */
         /* but only if a parameter follows                                        */
-        if (strlen(&whichcmd[count]) > 0)                                       
-          WCMD_echo(&whichcmd[count+1]);                                        
-        else                                                                    
-          WCMD_echo(&whichcmd[count]);                                          
-        break;                         
+        if (strlen(&whichcmd[count]) > 0)
+          WCMD_echo(&whichcmd[count+1]);
+        else
+          WCMD_echo(&whichcmd[count]);
+        break;
       case WCMD_FOR:
         WCMD_for (p);
         break;
@@ -309,8 +309,8 @@
         WCMD_setshow_time ();
         break;
       case WCMD_TITLE:
-        if (strlen(&whichcmd[count]) > 0)                                       
-          WCMD_title(&whichcmd[count+1]);                                        
+        if (strlen(&whichcmd[count]) > 0)
+          WCMD_title(&whichcmd[count+1]);
         break;
       case WCMD_TYPE:
         WCMD_type ();
@@ -327,7 +327,7 @@
       case WCMD_EXIT:
         ExitProcess (0);
       default:
-        WCMD_run_program (whichcmd);                   
+        WCMD_run_program (whichcmd);
     };
     if (old_stdin) {
       CloseHandle (GetStdHandle (STD_INPUT_HANDLE));
@@ -582,7 +582,7 @@
   va_end(ap);
 }
 
-/******************************************************************* 
+/*******************************************************************
  * WCMD_output_asis - send output to current standard output device.
  *        without formatting eg. when message contains '%'
  */
diff --git a/programs/wineconsole/dialog.c b/programs/wineconsole/dialog.c
index 945fb31..61bb8e0 100644
--- a/programs/wineconsole/dialog.c
+++ b/programs/wineconsole/dialog.c
@@ -29,7 +29,7 @@
 
 enum WCUSER_ApplyTo {
     /* Prop sheet CFG */
-    WCUSER_ApplyToCursorSize, 
+    WCUSER_ApplyToCursorSize,
     WCUSER_ApplyToHistorySize, WCUSER_ApplyToHistoryMode, WCUSER_ApplyToMenuMask,
     WCUSER_ApplyToEditMode,
     /* Prop sheet FNT */
@@ -38,13 +38,13 @@
     WCUSER_ApplyToBufferSize, WCUSER_ApplyToWindow
 };
 
-struct dialog_info 
+struct dialog_info
 {
     struct config_data* config;         /* pointer to configuration used for dialog box */
     struct inner_data*	data;	        /* pointer to current winecon info */
     HWND		hDlg;		/* handle to active propsheet */
     int			nFont;		/* number of font size in size LB */
-    struct font_info 
+    struct font_info
     {
         UINT                    height;
         UINT                    weight;
@@ -80,7 +80,7 @@
             LOGFONT     lf;
             HFONT       hFont;
 
-            WCUSER_FillLogFont(&lf, di->font[val].faceName, 
+            WCUSER_FillLogFont(&lf, di->font[val].faceName,
                                di->font[val].height, di->font[val].weight);
             hFont = WCUSER_CopyFont(di->config, PRIVATE(di->data)->hWnd, &lf);
             DeleteObject(hFont);
@@ -127,7 +127,7 @@
     case WCUSER_ApplyToFont:
         {
             LOGFONT lf;
-            WCUSER_FillLogFont(&lf, di->font[val].faceName, 
+            WCUSER_FillLogFont(&lf, di->font[val].faceName,
                                di->font[val].height, di->font[val].weight);
             WCUSER_SetFont(di->data, &lf);
         }
@@ -156,8 +156,8 @@
 {
     struct dialog_info*		di;
     unsigned 			idc;
-    
-    switch (msg) 
+
+    switch (msg)
     {
     case WM_INITDIALOG:
 	di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam;
@@ -171,11 +171,11 @@
 	SetDlgItemInt(hDlg, IDC_OPT_HIST_SIZE, WINECON_GetHistorySize(di->data->hConIn),  FALSE);
 	if (WINECON_GetHistoryMode(di->data->hConIn))
 	    SendDlgItemMessage(hDlg, IDC_OPT_HIST_DOUBLE, BM_SETCHECK, BST_CHECKED, 0L);
-        SendDlgItemMessage(hDlg, IDC_OPT_CONF_CTRL, BM_SETCHECK, 
+        SendDlgItemMessage(hDlg, IDC_OPT_CONF_CTRL, BM_SETCHECK,
                            (di->config->menu_mask & MK_CONTROL) ? BST_CHECKED : BST_UNCHECKED, 0L);
-        SendDlgItemMessage(hDlg, IDC_OPT_CONF_SHIFT, BM_SETCHECK, 
+        SendDlgItemMessage(hDlg, IDC_OPT_CONF_SHIFT, BM_SETCHECK,
                            (di->config->menu_mask & MK_SHIFT) ? BST_CHECKED : BST_UNCHECKED, 0L);
-        SendDlgItemMessage(hDlg, IDC_OPT_QUICK_EDIT, BM_SETCHECK, 
+        SendDlgItemMessage(hDlg, IDC_OPT_QUICK_EDIT, BM_SETCHECK,
                            (di->config->quick_edit) ? BST_CHECKED : BST_UNCHECKED, 0L);
 	return FALSE; /* because we set the focus */
     case WM_COMMAND:
@@ -188,14 +188,14 @@
 
 	di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER);
 
-	switch (nmhdr->code) 
+	switch (nmhdr->code)
 	{
 	case PSN_SETACTIVE:
 	    /* needed in propsheet to keep properly the selected radio button
 	     * otherwise, the focus would be set to the first tab stop in the
 	     * propsheet, which would always activate the first radio button
 	     */
-	    if (IsDlgButtonChecked(hDlg, IDC_OPT_CURSOR_SMALL) == BST_CHECKED) 
+	    if (IsDlgButtonChecked(hDlg, IDC_OPT_CURSOR_SMALL) == BST_CHECKED)
 		idc = IDC_OPT_CURSOR_SMALL;
 	    else if (IsDlgButtonChecked(hDlg, IDC_OPT_CURSOR_MEDIUM) == BST_CHECKED)
 		idc = IDC_OPT_CURSOR_MEDIUM;
@@ -213,7 +213,7 @@
  	    val = GetDlgItemInt(hDlg, IDC_OPT_HIST_SIZE, &done, FALSE);
 	    if (done) (di->apply)(di, hDlg, WCUSER_ApplyToHistorySize, val);
 
-	    (di->apply)(di, hDlg, WCUSER_ApplyToHistoryMode, 
+	    (di->apply)(di, hDlg, WCUSER_ApplyToHistoryMode,
                         IsDlgButtonChecked(hDlg, IDC_OPT_HIST_DOUBLE) & BST_CHECKED);
 
             val = 0;
@@ -272,13 +272,13 @@
             int		        size_idx;
             struct dialog_info*	di;
             HFONT	        hFont, hOldFont;
-            
+
             di = (struct dialog_info*)GetWindowLong(GetParent(hWnd), DWL_USER);
             BeginPaint(hWnd, &ps);
 
             font_idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0L, 0L);
             size_idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_GETCURSEL, 0L, 0L);
-            
+
             hFont = (HFONT)GetWindowLong(hWnd, 0L);
             if (hFont)
             {
@@ -286,12 +286,12 @@
                 WCHAR	buf2[256];
                 int	len1, len2;
 
-                len1 = LoadString(GetModuleHandle(NULL), IDS_FNT_PREVIEW_1, 
+                len1 = LoadString(GetModuleHandle(NULL), IDS_FNT_PREVIEW_1,
                                   buf1, sizeof(buf1) / sizeof(WCHAR));
                 len2 = LoadString(GetModuleHandle(NULL), IDS_FNT_PREVIEW_2,
                                   buf2, sizeof(buf2) / sizeof(WCHAR));
                 buf1[len1] = buf2[len2] = 0;
-                if (len1) 
+                if (len1)
                 {
                     hOldFont = SelectObject(ps.hdc, hFont);
                     SetBkColor(ps.hdc, WCUSER_ColorMap[GetWindowLong(GetDlgItem(di->hDlg, IDC_FNT_COLOR_BK), 0)]);
@@ -326,11 +326,11 @@
             int             i, step;
             RECT            client, r;
             HBRUSH          hbr;
-            
+
             BeginPaint(hWnd, &ps);
             GetClientRect(hWnd, &client);
             step = client.right / 8;
-            
+
             for (i = 0; i < 16; i++)
             {
                 r.top = (i / 8) * (client.bottom / 2);
@@ -370,7 +370,7 @@
         {
             int             i, step;
             RECT            client;
-            
+
             GetClientRect(hWnd, &client);
             step = client.right / 8;
             i = (HIWORD(lParam) >= client.bottom / 2) ? 8 : 0;
@@ -391,7 +391,7 @@
  *
  * enumerates all the font names with at least one valid font
  */
-static int CALLBACK font_enum_size2(const LOGFONT* lf, const TEXTMETRIC* tm, 
+static int CALLBACK font_enum_size2(const LOGFONT* lf, const TEXTMETRIC* tm,
 				    DWORD FontType, LPARAM lParam)
 {
     struct dialog_info*	di = (struct dialog_info*)lParam;
@@ -405,7 +405,7 @@
     return 1;
 }
 
-static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm, 
+static int CALLBACK font_enum(const LOGFONT* lf, const TEXTMETRIC* tm,
 			      DWORD FontType, LPARAM lParam)
 {
     struct dialog_info*	di = (struct dialog_info*)lParam;
@@ -420,10 +420,10 @@
         }
         else
             di->nFont = 1;
-        
+
         if (di->nFont)
 	{
- 	    SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_ADDSTRING, 
+ 	    SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_ADDSTRING,
                                0, (LPARAM)lf->lfFaceName);
         }
     }
@@ -436,7 +436,7 @@
  *
  *
  */
-static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm, 
+static int CALLBACK font_enum_size(const LOGFONT* lf, const TEXTMETRIC* tm,
 				   DWORD FontType, LPARAM lParam)
 {
     struct dialog_info*	di = (struct dialog_info*)lParam;
@@ -477,11 +477,11 @@
 	 * do the job by hand... get where to insert the new string
 	 */
 	for (idx = 0; idx < di->nFont && tm->tmHeight > di->font[idx].height; idx++);
-        while (idx < di->nFont && 
-               tm->tmHeight == di->font[idx].height && 
+        while (idx < di->nFont &&
+               tm->tmHeight == di->font[idx].height &&
                tm->tmWeight > di->font[idx].weight)
             idx++;
-        if (idx == di->nFont || 
+        if (idx == di->nFont ||
             tm->tmHeight != di->font[idx].height ||
             tm->tmWeight < di->font[idx].weight)
         {
@@ -521,8 +521,8 @@
 
     if (font_idx < 0 || size_idx < 0 || size_idx >= di->nFont)
 	return FALSE;
-    
-    WCUSER_FillLogFont(&lf, di->font[size_idx].faceName, 
+
+    WCUSER_FillLogFont(&lf, di->font[size_idx].faceName,
                        di->font[size_idx].height, di->font[size_idx].weight);
     hFont = WCUSER_CopyFont(&config, PRIVATE(di->data)->hWnd, &lf);
     if (!hFont) return FALSE;
@@ -555,7 +555,7 @@
 
     idx = SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETCURSEL, 0L, 0L);
     if (idx < 0) return FALSE;
-    
+
     SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_GETTEXT, idx, (LPARAM)lfFaceName);
     SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_SIZE, LB_RESETCONTENT, 0L, 0L);
     if (di->font) HeapFree(GetProcessHeap(), 0, di->font);
@@ -596,7 +596,7 @@
 {
     SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_RESETCONTENT, 0L, 0L);
     EnumFontFamilies(PRIVATE(di->data)->hMemDC, NULL, font_enum, (LPARAM)di);
-    if (SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_SELECTSTRING, 
+    if (SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_SELECTSTRING,
 			   (WPARAM)-1, (LPARAM)di->config->face_name) == LB_ERR)
 	SendDlgItemMessage(di->hDlg, IDC_FNT_LIST_FONT, LB_SETCURSEL, 0L, 0L);
     fill_list_size(di, TRUE);
@@ -612,7 +612,7 @@
 {
     struct dialog_info*		di;
 
-    switch (msg) 
+    switch (msg)
     {
     case WM_INITDIALOG:
 	di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam;
@@ -626,15 +626,15 @@
 	break;
     case WM_COMMAND:
 	di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER);
-	switch (LOWORD(wParam)) 
+	switch (LOWORD(wParam))
 	{
-	case IDC_FNT_LIST_FONT:	
+	case IDC_FNT_LIST_FONT:
 	    if (HIWORD(wParam) == LBN_SELCHANGE)
 	    {
 		fill_list_size(di, FALSE);
 	    }
 	    break;
-	case IDC_FNT_LIST_SIZE:	
+	case IDC_FNT_LIST_SIZE:
 	    if (HIWORD(wParam) == LBN_SELCHANGE)
 	    {
 		select_font(di);
@@ -648,7 +648,7 @@
         DWORD   val;
 
 	di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER);
-	switch (nmhdr->code) 
+	switch (nmhdr->code)
 	{
         case PSN_SETACTIVE:
             di->hDlg = hDlg;
@@ -658,7 +658,7 @@
 
 	    if (val < di->nFont) (di->apply)(di, hDlg, WCUSER_ApplyToFont, val);
 
-            (di->apply)(di, hDlg, WCUSER_ApplyToAttribute, 
+            (di->apply)(di, hDlg, WCUSER_ApplyToAttribute,
                         (GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_BK), 0) << 4) |
                         GetWindowLong(GetDlgItem(hDlg, IDC_FNT_COLOR_FG), 0));
 
@@ -684,7 +684,7 @@
 {
     struct dialog_info*		di;
 
-    switch (msg) 
+    switch (msg)
     {
     case WM_INITDIALOG:
 	di = (struct dialog_info*)((PROPSHEETPAGEA*)lParam)->lParam;
@@ -697,7 +697,7 @@
 	break;
     case WM_COMMAND:
 	di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER);
-	switch (LOWORD(wParam)) 
+	switch (LOWORD(wParam))
 	{
 	}
 	break;
@@ -709,7 +709,7 @@
         BOOL	        st_w, st_h;
 
 	di = (struct dialog_info*)GetWindowLong(hDlg, DWL_USER);
-	switch (nmhdr->code) 
+	switch (nmhdr->code)
 	{
         case PSN_SETACTIVE:
             di->hDlg = hDlg;
@@ -721,10 +721,10 @@
             {
                 (di->apply)(di, hDlg, WCUSER_ApplyToBufferSize, (DWORD)&sb);
             }
-            
+
             pos.Right  = GetDlgItemInt(hDlg, IDC_CNF_WIN_WIDTH,  &st_w, FALSE);
             pos.Bottom = GetDlgItemInt(hDlg, IDC_CNF_WIN_HEIGHT, &st_h, FALSE);
-            if (st_w && st_h && 
+            if (st_w && st_h &&
                 (pos.Right != di->config->win_width || pos.Bottom != di->config->win_height))
             {
                 pos.Left = pos.Top = 0;
@@ -821,8 +821,8 @@
     memset(&psHead, 0, sizeof(psHead));
     psHead.dwSize = sizeof(psHead);
 
-    if (!LoadString(GetModuleHandle(NULL), 
-                    (current) ? IDS_DLG_TIT_CURRENT : IDS_DLG_TIT_DEFAULT, 
+    if (!LoadString(GetModuleHandle(NULL),
+                    (current) ? IDS_DLG_TIT_CURRENT : IDS_DLG_TIT_DEFAULT,
                     buff, sizeof(buff) / sizeof(buff[0])))
     {
         buff[0] = 'S';
@@ -837,7 +837,7 @@
     psHead.nPages = 3;
     psHead.hwndParent = PRIVATE(data)->hWnd;
     psHead.u3.phpage = psPage;
- 
+
     PropertySheet(&psHead);
 
     return TRUE;
diff --git a/programs/wineconsole/registry.c b/programs/wineconsole/registry.c
index a1c9e4e..a74ad0b 100644
--- a/programs/wineconsole/registry.c
+++ b/programs/wineconsole/registry.c
@@ -56,63 +56,63 @@
     if (RegOpenKey(HKEY_CURRENT_USER, wszConsole, &hConKey)) hConKey = 0;
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszCursorSize, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszCursorSize, 0, &type, (char*)&val, &count))
         val = 25;
     cfg->cursor_size = val;
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszCursorVisible, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszCursorVisible, 0, &type, (char*)&val, &count))
         val = 1;
     cfg->cursor_visible = val;
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszExitOnDie, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszExitOnDie, 0, &type, (char*)&val, &count))
         val = 1;
     cfg->exit_on_die = val;
 
-    count = sizeof(cfg->face_name); 
+    count = sizeof(cfg->face_name);
     if (!hConKey || RegQueryValueEx(hConKey, wszFaceName, 0, &type, (char*)&cfg->face_name, &count))
         cfg->face_name[0] = 0;
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszFontSize, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszFontSize, 0, &type, (char*)&val, &count))
         val = 0x000C0008;
     cfg->cell_height = HIWORD(val);
     cfg->cell_width  = LOWORD(val);
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszFontWeight, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszFontWeight, 0, &type, (char*)&val, &count))
         val = 0;
     cfg->font_weight = val;
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszHistoryBufferSize, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszHistoryBufferSize, 0, &type, (char*)&val, &count))
         val = 0;
     cfg->history_size = val;
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszMenuMask, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszMenuMask, 0, &type, (char*)&val, &count))
         val = 0;
     cfg->menu_mask = val;
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszQuickEdit, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszQuickEdit, 0, &type, (char*)&val, &count))
         val = 0;
     cfg->quick_edit = val;
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszScreenBufferSize, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszScreenBufferSize, 0, &type, (char*)&val, &count))
         val = 0x00190050;
     cfg->sb_height = HIWORD(val);
     cfg->sb_width  = LOWORD(val);
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszScreenColors, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszScreenColors, 0, &type, (char*)&val, &count))
         val = 0x000F;
     cfg->def_attr = val;
 
     count = sizeof(val);
-    if (!hConKey || RegQueryValueEx(hConKey, wszWindowSize, 0, &type, (char*)&val, &count)) 
+    if (!hConKey || RegQueryValueEx(hConKey, wszWindowSize, 0, &type, (char*)&val, &count))
         val = 0x00190050;
     cfg->win_height = HIWORD(val);
     cfg->win_width  = LOWORD(val);
@@ -133,12 +133,12 @@
     HKEY        hConKey;
     DWORD       val;
 
-    if (RegCreateKey(HKEY_CURRENT_USER, wszConsole, &hConKey)) 
+    if (RegCreateKey(HKEY_CURRENT_USER, wszConsole, &hConKey))
     {
         WINE_ERR("Can't open registry for saving\n");
         return FALSE;
     }
-   
+
     val = cfg->cursor_size;
     RegSetValueEx(hConKey, wszCursorSize, 0, REG_DWORD, (char*)&val, sizeof(val));
 
diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c
index 62ae7f1..0e3e9a4 100644
--- a/programs/wineconsole/user.c
+++ b/programs/wineconsole/user.c
@@ -28,7 +28,7 @@
 WINE_DECLARE_DEBUG_CHANNEL(wc_font);
 
 /* mapping console colors to RGB values */
-COLORREF	WCUSER_ColorMap[16] = 
+COLORREF	WCUSER_ColorMap[16] =
 {
     RGB(0x00, 0x00, 0x00), RGB(0x00, 0x00, 0x80), RGB(0x00, 0x80, 0x00), RGB(0x00, 0x80, 0x80),
     RGB(0x80, 0x00, 0x00), RGB(0x80, 0x00, 0x80), RGB(0x80, 0x80, 0x00), RGB(0x80, 0x80, 0x80),
@@ -49,7 +49,7 @@
     WORD		attr;
     WCHAR*		line;
 
-    /* no font has been set up yet, don't worry about filling the bitmap, 
+    /* no font has been set up yet, don't worry about filling the bitmap,
      * we'll do it once a font is chosen
      */
     if (!PRIVATE(data)->hFont) return;
@@ -70,7 +70,7 @@
 	    {
 		line[k - i] = cell[k].Char.UnicodeChar;
 	    }
-	    TextOut(PRIVATE(data)->hMemDC, i * data->curcfg.cell_width, j * data->curcfg.cell_height, 
+	    TextOut(PRIVATE(data)->hMemDC, i * data->curcfg.cell_width, j * data->curcfg.cell_height,
 		    line, k - i);
 	    i = k - 1;
 	}
@@ -90,11 +90,11 @@
     HDC         hDC;
     HBITMAP	hnew, hold;
 
-    if (!data->curcfg.sb_width || !data->curcfg.sb_height || 
+    if (!data->curcfg.sb_width || !data->curcfg.sb_height ||
         !PRIVATE(data)->hFont || !(hDC = GetDC(PRIVATE(data)->hWnd)))
         return;
-    hnew = CreateCompatibleBitmap(hDC, 
-				  data->curcfg.sb_width  * data->curcfg.cell_width, 
+    hnew = CreateCompatibleBitmap(hDC,
+				  data->curcfg.sb_width  * data->curcfg.cell_width,
 				  data->curcfg.sb_height * data->curcfg.cell_height);
     ReleaseDC(PRIVATE(data)->hWnd, hDC);
     hold = SelectObject(PRIVATE(data)->hMemDC, hnew);
@@ -130,9 +130,9 @@
 {
     if (PRIVATE(data)->hWnd != GetFocus() || !data->curcfg.cursor_visible) return;
 
-    SetCaretPos((data->cursor.X - data->curcfg.win_pos.X) * data->curcfg.cell_width, 
+    SetCaretPos((data->cursor.X - data->curcfg.win_pos.X) * data->curcfg.cell_width,
 		(data->cursor.Y - data->curcfg.win_pos.Y) * data->curcfg.cell_height);
-    ShowCaret(PRIVATE(data)->hWnd); 
+    ShowCaret(PRIVATE(data)->hWnd);
 }
 
 /******************************************************************
@@ -164,7 +164,7 @@
 		    ptr[w16b * j + (i / 8)] |= 0x80 >> (i & 7);
 		}
 	    }
-	    PRIVATE(data)->cursor_bitmap = CreateBitmap(data->curcfg.cell_width, 
+	    PRIVATE(data)->cursor_bitmap = CreateBitmap(data->curcfg.cell_width,
                                                data->curcfg.cell_height, 1, 1, ptr);
 	    HeapFree(GetProcessHeap(), 0, ptr);
 	}
@@ -180,7 +180,7 @@
 	{
 	    if (vis)
 	    {
-		CreateCaret(PRIVATE(data)->hWnd, PRIVATE(data)->cursor_bitmap, 
+		CreateCaret(PRIVATE(data)->hWnd, PRIVATE(data)->cursor_bitmap,
                             data->curcfg.cell_width, data->curcfg.cell_height);
 		WCUSER_PosCursor(data);
 	    }
@@ -219,7 +219,7 @@
     if (data->curcfg.sb_width > data->curcfg.win_width)
     {
 	dy = GetSystemMetrics(SM_CYHSCROLL);
-	SetScrollRange(PRIVATE(data)->hWnd, SB_HORZ, 0, 
+	SetScrollRange(PRIVATE(data)->hWnd, SB_HORZ, 0,
                        data->curcfg.sb_width - data->curcfg.win_width, FALSE);
 	SetScrollPos(PRIVATE(data)->hWnd, SB_HORZ, 0, FALSE); /* FIXME */
 	ShowScrollBar(PRIVATE(data)->hWnd, SB_HORZ, TRUE);
@@ -232,11 +232,11 @@
     if (data->curcfg.sb_height > data->curcfg.win_height)
     {
 	dx = GetSystemMetrics(SM_CXVSCROLL);
-	SetScrollRange(PRIVATE(data)->hWnd, SB_VERT, 0, 
+	SetScrollRange(PRIVATE(data)->hWnd, SB_VERT, 0,
                        data->curcfg.sb_height - data->curcfg.win_height, FALSE);
 	SetScrollPos(PRIVATE(data)->hWnd, SB_VERT, 0, FALSE); /* FIXME */
 	ShowScrollBar(PRIVATE(data)->hWnd, SB_VERT, TRUE);
-    }	
+    }
     else
     {
 	ShowScrollBar(PRIVATE(data)->hWnd, SB_VERT, FALSE);
@@ -255,7 +255,7 @@
  */
 static void	WCUSER_SetTitle(const struct inner_data* data)
 {
-    WCHAR	buffer[256];	
+    WCHAR	buffer[256];
 
     if (WINECON_GetConsoleTitle(data->hConIn, buffer, sizeof(buffer)))
 	SetWindowText(PRIVATE(data)->hWnd, buffer);
@@ -269,13 +269,13 @@
                          "\tlf.lfCharSet=%u lf.lfOutPrecision=%u lf.lfClipPrecision=%u lf.lfQuality=%u\n"
                          "\tlf->lfPitchAndFamily=%u lf.lfFaceName=%s\n",
                          pfx,
-                         (ft & RASTER_FONTTYPE) ? "raster" : "", 
-                         (ft & TRUETYPE_FONTTYPE) ? "truetype" : "", 
-                         ((ft & (RASTER_FONTTYPE|TRUETYPE_FONTTYPE)) == 0) ? "vector" : "", 
-                         (ft & DEVICE_FONTTYPE) ? "|device" : "", 
-                         lf->lfHeight, lf->lfWidth, lf->lfEscapement, lf->lfOrientation, 
+                         (ft & RASTER_FONTTYPE) ? "raster" : "",
+                         (ft & TRUETYPE_FONTTYPE) ? "truetype" : "",
+                         ((ft & (RASTER_FONTTYPE|TRUETYPE_FONTTYPE)) == 0) ? "vector" : "",
+                         (ft & DEVICE_FONTTYPE) ? "|device" : "",
+                         lf->lfHeight, lf->lfWidth, lf->lfEscapement, lf->lfOrientation,
                          lf->lfWeight, lf->lfItalic, lf->lfUnderline, lf->lfStrikeOut, lf->lfCharSet,
-                         lf->lfOutPrecision, lf->lfClipPrecision, lf->lfQuality, lf->lfPitchAndFamily, 
+                         lf->lfOutPrecision, lf->lfClipPrecision, lf->lfQuality, lf->lfPitchAndFamily,
                          wine_dbgstr_w(lf->lfFaceName));
 }
 
@@ -287,13 +287,13 @@
                          "\ttmDigitizedAspectX=%ld tmDigitizedAspectY=%ld\n"
                          "\ttmFirstChar=%d tmLastChar=%d tmDefaultChar=%d tmBreakChar=%d\n"
                          "\ttmItalic=%u tmUnderlined=%u tmStruckOut=%u tmPitchAndFamily=%u tmCharSet=%u\n",
-                         (ft & RASTER_FONTTYPE) ? "raster" : "", 
-                         (ft & TRUETYPE_FONTTYPE) ? "truetype" : "", 
-                         ((ft & (RASTER_FONTTYPE|TRUETYPE_FONTTYPE)) == 0) ? "vector" : "", 
-                         (ft & DEVICE_FONTTYPE) ? "|device" : "", 
-                         tm->tmHeight, tm->tmAscent, tm->tmDescent, tm->tmInternalLeading, tm->tmExternalLeading, tm->tmAveCharWidth, 
-                         tm->tmMaxCharWidth, tm->tmWeight, tm->tmOverhang, tm->tmDigitizedAspectX, tm->tmDigitizedAspectY, 
-                         tm->tmFirstChar, tm->tmLastChar, tm->tmDefaultChar, tm->tmBreakChar, tm->tmItalic, tm->tmUnderlined, tm->tmStruckOut, 
+                         (ft & RASTER_FONTTYPE) ? "raster" : "",
+                         (ft & TRUETYPE_FONTTYPE) ? "truetype" : "",
+                         ((ft & (RASTER_FONTTYPE|TRUETYPE_FONTTYPE)) == 0) ? "vector" : "",
+                         (ft & DEVICE_FONTTYPE) ? "|device" : "",
+                         tm->tmHeight, tm->tmAscent, tm->tmDescent, tm->tmInternalLeading, tm->tmExternalLeading, tm->tmAveCharWidth,
+                         tm->tmMaxCharWidth, tm->tmWeight, tm->tmOverhang, tm->tmDigitizedAspectX, tm->tmDigitizedAspectY,
+                         tm->tmFirstChar, tm->tmLastChar, tm->tmDefaultChar, tm->tmBreakChar, tm->tmItalic, tm->tmUnderlined, tm->tmStruckOut,
                          tm->tmPitchAndFamily, tm->tmCharSet);
 }
 
@@ -310,7 +310,7 @@
         !lstrcmp(lf->lfFaceName, config->face_name);
 }
 
-struct font_chooser 
+struct font_chooser
 {
     struct inner_data*	data;
     int			done;
@@ -339,7 +339,7 @@
  */
 BOOL	WCUSER_ValidateFont(const struct inner_data* data, const LOGFONT* lf)
 {
-    return (lf->lfPitchAndFamily & 3) == FIXED_PITCH && 
+    return (lf->lfPitchAndFamily & 3) == FIXED_PITCH &&
         /* (lf->lfPitchAndFamily & 0xF0) == FF_MODERN && */
         (lf->lfCharSet == DEFAULT_CHARSET || lf->lfCharSet == ANSI_CHARSET);
 }
@@ -350,7 +350,7 @@
  *
  * Helper functions to get a decent font for the renderer
  */
-static int CALLBACK get_first_font_enum_2(const LOGFONT* lf, const TEXTMETRIC* tm, 
+static int CALLBACK get_first_font_enum_2(const LOGFONT* lf, const TEXTMETRIC* tm,
 					  DWORD FontType, LPARAM lParam)
 {
     struct font_chooser*	fc = (struct font_chooser*)lParam;
@@ -361,7 +361,7 @@
         LOGFONT mlf = *lf;
 
         /* Use the default sizes for the font (this is needed, especially for
-         * TrueType fonts, so that we get a decent size, not the max size) 
+         * TrueType fonts, so that we get a decent size, not the max size)
          */
         mlf.lfWidth  = fc->data->curcfg.cell_width;
         mlf.lfHeight = fc->data->curcfg.cell_height;
@@ -369,7 +369,7 @@
         {
             WCUSER_DumpLogFont("InitChoosing: ", &mlf, FontType);
             fc->done = 1;
-            /* since we've modified the current config with new font information, 
+            /* since we've modified the current config with new font information,
              * set this information as the new default.
              */
             fc->data->defcfg.cell_width = fc->data->curcfg.cell_width;
@@ -385,7 +385,7 @@
     return 1;
 }
 
-static int CALLBACK get_first_font_enum(const LOGFONT* lf, const TEXTMETRIC* tm, 
+static int CALLBACK get_first_font_enum(const LOGFONT* lf, const TEXTMETRIC* tm,
 					DWORD FontType, LPARAM lParam)
 {
     struct font_chooser*	fc = (struct font_chooser*)lParam;
@@ -393,7 +393,7 @@
     WCUSER_DumpLogFont("InitFamily: ", lf, FontType);
     if (WCUSER_ValidateFont(fc->data, lf))
     {
-	EnumFontFamilies(PRIVATE(fc->data)->hMemDC, lf->lfFaceName, 
+	EnumFontFamilies(PRIVATE(fc->data)->hMemDC, lf->lfFaceName,
                          get_first_font_enum_2, lParam);
 	return !fc->done; /* we just need the first matching one... */
     }
@@ -426,7 +426,7 @@
      *  - the average width
      *  - the largest width
      *  - the width of all characters in the font
-     * This isn't true in Wine. As a temporary workaound, we get as the width of the 
+     * This isn't true in Wine. As a temporary workaound, we get as the width of the
      * cell, the width of the first character in the font, after checking that all
      * characters in the font have the same width (I hear paranoïa coming)
      * when this gets fixed, the should be using tm.tmAveCharWidth or tm.tmMaxCharWidth
@@ -436,15 +436,15 @@
     for (i = tm.tmFirstChar + 1; i <= tm.tmLastChar; i += sizeof(buf) / sizeof(buf[0]))
     {
         int j, l;
-            
+
         l = min(tm.tmLastChar - i, sizeof(buf) / sizeof(buf[0]) - 1);
         GetCharWidth32(hDC, i, i + l, buf);
-        for (j = 0; j <= l; j++) 
+        for (j = 0; j <= l; j++)
         {
             if (buf[j] != w)
             {
                 WINE_WARN("Non uniform cell width: [%d]=%d [%d]=%d\n"
-                          "This may be caused by old freetype libraries, >= 2.0.8 is recommended\n", 
+                          "This may be caused by old freetype libraries, >= 2.0.8 is recommended\n",
                           i + j, buf[j], tm.tmFirstChar, w);
                 goto err;
             }
@@ -486,7 +486,7 @@
     lf->lfStrikeOut     = FALSE;
     lf->lfCharSet       = DEFAULT_CHARSET;
     lf->lfOutPrecision  = OUT_DEFAULT_PRECIS;
-    lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; 
+    lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
     lf->lfQuality       = DEFAULT_QUALITY;
     lf->lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
     lstrcpy(lf->lfFaceName, name);
@@ -501,7 +501,7 @@
 {
     HFONT       hFont;
 
-    if (PRIVATE(data)->hFont != 0 && WCUSER_AreFontsEqual(&data->curcfg, logfont)) 
+    if (PRIVATE(data)->hFont != 0 && WCUSER_AreFontsEqual(&data->curcfg, logfont))
         return TRUE;
 
     hFont = WCUSER_CopyFont(&data->curcfg, PRIVATE(data)->hWnd, logfont);
@@ -535,11 +535,11 @@
     {
         LOGFONT             lf;
 
-        WCUSER_FillLogFont(&lf, data->curcfg.face_name, 
+        WCUSER_FillLogFont(&lf, data->curcfg.face_name,
                            data->curcfg.cell_height, data->curcfg.font_weight);
         if (PRIVATE(data)->hFont != 0) WINE_FIXME("Oh strange\n");
 
-        if (WCUSER_SetFont(data, &lf)) 
+        if (WCUSER_SetFont(data, &lf))
         {
             WCUSER_DumpLogFont("InitReuses: ", &lf, 0);
             return TRUE;
@@ -668,7 +668,7 @@
 
 	c.X = data->curcfg.win_pos.X + min(PRIVATE(data)->selectPt1.X, PRIVATE(data)->selectPt2.X);
 	c.Y = data->curcfg.win_pos.Y + min(PRIVATE(data)->selectPt1.Y, PRIVATE(data)->selectPt2.Y);
-	
+
 	for (y = 0; y < h; y++, c.Y++)
 	{
 	    ReadConsoleOutputCharacter(data->hConOut, &p[y * w], w - 1, c, NULL);
@@ -712,10 +712,10 @@
 	    ir[0].Event.KeyEvent.wVirtualKeyCode = LOBYTE(sh);
 	    ir[0].Event.KeyEvent.wVirtualScanCode = MapVirtualKey(LOBYTE(sh), 0);
 	    ir[0].Event.KeyEvent.uChar.UnicodeChar = ptr[i];
-	    
+
 	    ir[1] = ir[0];
 	    ir[1].Event.KeyEvent.bKeyDown = FALSE;
-	    
+
 	    WriteConsoleInput(data->hConIn, ir, 2, &n);
 	}
 	GlobalUnlock(h);
@@ -754,11 +754,11 @@
     PAINTSTRUCT		ps;
 
     BeginPaint(PRIVATE(data)->hWnd, &ps);
-    BitBlt(ps.hdc, 0, 0, 
-           data->curcfg.win_width * data->curcfg.cell_width, 
+    BitBlt(ps.hdc, 0, 0,
+           data->curcfg.win_width * data->curcfg.cell_width,
            data->curcfg.win_height * data->curcfg.cell_height,
-	   PRIVATE(data)->hMemDC, 
-           data->curcfg.win_pos.X * data->curcfg.cell_width, 
+	   PRIVATE(data)->hMemDC,
+           data->curcfg.win_pos.X * data->curcfg.cell_width,
            data->curcfg.win_pos.Y * data->curcfg.cell_height,
 	   SRCCOPY);
     if (PRIVATE(data)->has_selection)
@@ -867,10 +867,10 @@
 {
     if (!hMenu) {WINE_ERR("Issue in getting menu bits\n");return;}
 
-    EnableMenuItem(hMenu, IDS_COPY, 
+    EnableMenuItem(hMenu, IDS_COPY,
                    MF_BYCOMMAND|(PRIVATE(data)->has_selection ? MF_ENABLED : MF_GRAYED));
-    EnableMenuItem(hMenu, IDS_PASTE, 
-		   MF_BYCOMMAND|(IsClipboardFormatAvailable(CF_UNICODETEXT) 
+    EnableMenuItem(hMenu, IDS_PASTE,
+		   MF_BYCOMMAND|(IsClipboardFormatAvailable(CF_UNICODETEXT)
 				 ? MF_ENABLED : MF_GRAYED));
     EnableMenuItem(hMenu, IDS_SCROLL, MF_BYCOMMAND|MF_GRAYED);
     EnableMenuItem(hMenu, IDS_SEARCH, MF_BYCOMMAND|MF_GRAYED);
@@ -892,10 +892,10 @@
     if (keyState[VK_RCONTROL] & 0x80)	ret |= RIGHT_CTRL_PRESSED;
     if (keyState[VK_LMENU]    & 0x80)	ret |= LEFT_ALT_PRESSED;
     if (keyState[VK_RMENU]    & 0x80)	ret |= RIGHT_ALT_PRESSED;
-    if (keyState[VK_CAPITAL]  & 0x01)	ret |= CAPSLOCK_ON;	    
+    if (keyState[VK_CAPITAL]  & 0x01)	ret |= CAPSLOCK_ON;
     if (keyState[VK_NUMLOCK]  & 0x01)	ret |= NUMLOCK_ON;
     if (keyState[VK_SCROLL]   & 0x01)	ret |= SCROLLLOCK_ON;
-    
+
     return ret;
 }
 
@@ -904,7 +904,7 @@
  *
  * Handles keys while selecting an area
  */
-static void WCUSER_HandleSelectionKey(struct inner_data* data, BOOL down, 
+static void WCUSER_HandleSelectionKey(struct inner_data* data, BOOL down,
                                       WPARAM wParam, LPARAM lParam)
 {
     BYTE	keyState[256];
@@ -1010,7 +1010,7 @@
  *
  * generates input_record from windows WM_KEYUP/WM_KEYDOWN messages
  */
-static void    WCUSER_GenerateKeyInputRecord(struct inner_data* data, BOOL down, 
+static void    WCUSER_GenerateKeyInputRecord(struct inner_data* data, BOOL down,
                                              WPARAM wParam, LPARAM lParam, BOOL sys)
 {
     INPUT_RECORD	ir;
@@ -1023,9 +1023,9 @@
     ir.Event.KeyEvent.bKeyDown = down;
     ir.Event.KeyEvent.wRepeatCount = LOWORD(lParam);
     ir.Event.KeyEvent.wVirtualKeyCode = wParam;
-    
+
     ir.Event.KeyEvent.wVirtualScanCode = HIWORD(lParam) & 0xFF;
-    
+
     ir.Event.KeyEvent.uChar.UnicodeChar = 0;
     ir.Event.KeyEvent.dwControlKeyState = WCUSER_GetCtrlKeyState(keyState);
     if (lParam & (1L << 24))		ir.Event.KeyEvent.dwControlKeyState |= ENHANCED_KEY;
@@ -1040,7 +1040,7 @@
 	    case 2:
 		/* FIXME... should generate two events... */
 		/* fall thru */
-	    case 1:	
+	    case 1:
 		last = buf[0];
 		break;
 	    default:
@@ -1060,7 +1060,7 @@
  *
  *
  */
-static void    WCUSER_GenerateMouseInputRecord(struct inner_data* data, COORD c, 
+static void    WCUSER_GenerateMouseInputRecord(struct inner_data* data, COORD c,
                                                WPARAM wParam, DWORD event)
 {
     INPUT_RECORD	ir;
@@ -1130,7 +1130,7 @@
                 PRIVATE(data)->has_selection = TRUE;
             }
         }
-        else 
+        else
         {
             WCUSER_GenerateMouseInputRecord(data, WCUSER_GetCell(data, lParam), wParam, 0);
         }
@@ -1152,7 +1152,7 @@
     case WM_LBUTTONUP:
         if (data->curcfg.quick_edit)
         {
-            if (GetCapture() == PRIVATE(data)->hWnd && PRIVATE(data)->has_selection && 
+            if (GetCapture() == PRIVATE(data)->hWnd && PRIVATE(data)->has_selection &&
                 (wParam& MK_LBUTTON))
             {
                 WCUSER_MoveSelection(data, PRIVATE(data)->selectPt1, WCUSER_GetCell(data, lParam), TRUE);
@@ -1170,91 +1170,91 @@
 
             GetWindowRect(hWnd, &r);
             WCUSER_SetMenuDetails(data, PRIVATE(data)->hPopMenu);
-            TrackPopupMenu(PRIVATE(data)->hPopMenu, TPM_LEFTALIGN|TPM_TOPALIGN, 
+            TrackPopupMenu(PRIVATE(data)->hPopMenu, TPM_LEFTALIGN|TPM_TOPALIGN,
                            r.left + LOWORD(lParam), r.top + HIWORD(lParam), 0, hWnd, NULL);
         }
         else
         {
             WCUSER_GenerateMouseInputRecord(data, WCUSER_GetCell(data, lParam), wParam, 0);
         }
-	break;    
+	break;
     case WM_RBUTTONUP:
         /* no need to track for rbutton up when opening the popup... the event will be
          * swallowed by TrackPopupMenu */
         WCUSER_GenerateMouseInputRecord(data, WCUSER_GetCell(data, lParam), wParam, 0);
-	break;    
+	break;
     case WM_MOUSEWHEEL:
         /* FIXME: should we scroll too ? */
         WCUSER_GenerateMouseInputRecord(data, WCUSER_GetCell(data, lParam), wParam, MOUSE_WHEELED);
-	break;    
+	break;
     case WM_SETFOCUS:
 	if (data->curcfg.cursor_visible)
 	{
-	    CreateCaret(PRIVATE(data)->hWnd, PRIVATE(data)->cursor_bitmap, 
-                        data->curcfg.cell_width, data->curcfg.cell_height); 
+	    CreateCaret(PRIVATE(data)->hWnd, PRIVATE(data)->cursor_bitmap,
+                        data->curcfg.cell_width, data->curcfg.cell_height);
 	    WCUSER_PosCursor(data);
 	}
-        break; 
-    case WM_KILLFOCUS: 
+        break;
+    case WM_KILLFOCUS:
 	if (data->curcfg.cursor_visible)
-	    DestroyCaret(); 
+	    DestroyCaret();
 	break;
-    case WM_HSCROLL: 
+    case WM_HSCROLL:
         {
             int	pos = data->curcfg.win_pos.X;
 
-            switch (LOWORD(wParam)) 
-            { 
-            case SB_PAGEUP: 	pos -= 8; 		break; 
-            case SB_PAGEDOWN: 	pos += 8; 		break; 
+            switch (LOWORD(wParam))
+            {
+            case SB_PAGEUP: 	pos -= 8; 		break;
+            case SB_PAGEDOWN: 	pos += 8; 		break;
             case SB_LINEUP: 	pos--;			break;
             case SB_LINEDOWN: 	pos++;	 		break;
             case SB_THUMBTRACK: pos = HIWORD(wParam);	break;
             default: 					break;
-            } 
+            }
             if (pos < 0) pos = 0;
-            if (pos > data->curcfg.sb_width - data->curcfg.win_width) 
+            if (pos > data->curcfg.sb_width - data->curcfg.win_width)
                 pos = data->curcfg.sb_width - data->curcfg.win_width;
             if (pos != data->curcfg.win_pos.X)
             {
-                ScrollWindow(hWnd, (data->curcfg.win_pos.X - pos) * data->curcfg.cell_width, 0, 
+                ScrollWindow(hWnd, (data->curcfg.win_pos.X - pos) * data->curcfg.cell_width, 0,
                              NULL, NULL);
                 data->curcfg.win_pos.X = pos;
-                SetScrollPos(hWnd, SB_HORZ, pos, TRUE); 
-                UpdateWindow(hWnd); 
+                SetScrollPos(hWnd, SB_HORZ, pos, TRUE);
+                UpdateWindow(hWnd);
                 WCUSER_PosCursor(data);
                 WINECON_NotifyWindowChange(data);
             }
         }
 	break;
-    case WM_VSCROLL: 
+    case WM_VSCROLL:
         {
 	    int	pos = data->curcfg.win_pos.Y;
 
-	    switch (LOWORD(wParam)) 
-	    { 
-            case SB_PAGEUP: 	pos -= 8; 		break; 
-            case SB_PAGEDOWN: 	pos += 8; 		break; 
+	    switch (LOWORD(wParam))
+	    {
+            case SB_PAGEUP: 	pos -= 8; 		break;
+            case SB_PAGEDOWN: 	pos += 8; 		break;
             case SB_LINEUP: 	pos--;			break;
 	    case SB_LINEDOWN: 	pos++;	 		break;
             case SB_THUMBTRACK: pos = HIWORD(wParam);	break;
             default: 					break;
-	    } 
+	    }
 	    if (pos < 0) pos = 0;
-	    if (pos > data->curcfg.sb_height - data->curcfg.win_height) 
+	    if (pos > data->curcfg.sb_height - data->curcfg.win_height)
                 pos = data->curcfg.sb_height - data->curcfg.win_height;
 	    if (pos != data->curcfg.win_pos.Y)
 	    {
-		ScrollWindow(hWnd, 0, (data->curcfg.win_pos.Y - pos) * data->curcfg.cell_height, 
+		ScrollWindow(hWnd, 0, (data->curcfg.win_pos.Y - pos) * data->curcfg.cell_height,
                              NULL, NULL);
 		data->curcfg.win_pos.Y = pos;
-		SetScrollPos(hWnd, SB_VERT, pos, TRUE); 
-		UpdateWindow(hWnd); 
+		SetScrollPos(hWnd, SB_VERT, pos, TRUE);
+		UpdateWindow(hWnd);
 		WCUSER_PosCursor(data);
 		WINECON_NotifyWindowChange(data);
 	    }
 
-        } 
+        }
     case WM_SYSCOMMAND:
 	switch (wParam)
 	{
@@ -1264,7 +1264,7 @@
 	case IDS_PROPERTY:
 	    WCUSER_GetProperties(data, TRUE);
 	    break;
-	default: 
+	default:
 	    return DefWindowProc(hWnd, uMsg, wParam, lParam);
 	}
 	break;
@@ -1305,7 +1305,7 @@
 	case IDS_SEARCH:
 	    WINE_FIXME("Unhandled yet command: %x\n", wParam);
 	    break;
-	default: 
+	default:
 	    return DefWindowProc(hWnd, uMsg, wParam, lParam);
 	}
 	break;
@@ -1344,7 +1344,7 @@
 {
     MSG		msg;
 
-    for (;;) 
+    for (;;)
     {
 	switch (MsgWaitForMultipleObjects(1, &data->hSynchro, FALSE, INFINITE, QS_ALLINPUT))
 	{
@@ -1369,7 +1369,7 @@
 	    /* err */
 	    break;
 	}
-    }	
+    }
 }
 
 /******************************************************************
@@ -1407,12 +1407,12 @@
     wndclass.hbrBackground = GetStockObject(BLACK_BRUSH);
     wndclass.lpszMenuName  = NULL;
     wndclass.lpszClassName = wClassName;
-  
+
     RegisterClass(&wndclass);
 
     CreateWindow(wndclass.lpszClassName, NULL,
-		 WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_HSCROLL|WS_VSCROLL, 
-		 CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0, 0, wndclass.hInstance, data);   
+		 WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_HSCROLL|WS_VSCROLL,
+		 CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0, 0, wndclass.hInstance, data);
     if (!PRIVATE(data)->hWnd) return FALSE;
 
     /* force update of current data */
diff --git a/programs/wineconsole/winecon_private.h b/programs/wineconsole/winecon_private.h
index 9f6e95a..bb8fd2a 100644
--- a/programs/wineconsole/winecon_private.h
+++ b/programs/wineconsole/winecon_private.h
@@ -25,7 +25,7 @@
 
 /* this is the configuration stored & loaded into the registry */
 struct config_data {
-    unsigned	cell_width;	/* width in pixels of a character */	
+    unsigned	cell_width;	/* width in pixels of a character */
     unsigned	cell_height;	/* height in pixels of a character */
     int		cursor_size;	/* in % of cell height */
     int		cursor_visible;
diff --git a/programs/wineconsole/winecon_user.h b/programs/wineconsole/winecon_user.h
index 7810f81..d62e662 100644
--- a/programs/wineconsole/winecon_user.h
+++ b/programs/wineconsole/winecon_user.h
@@ -45,12 +45,12 @@
 extern BOOL WCUSER_GetProperties(struct inner_data*, BOOL);
 extern BOOL WCUSER_SetFont(struct inner_data* data, const LOGFONT* font);
 extern BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONT* lf);
-extern BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, 
+extern BOOL WCUSER_ValidateFontMetric(const struct inner_data* data,
                                       const TEXTMETRIC* tm, DWORD fontType);
-extern BOOL WCUSER_AreFontsEqual(const struct config_data* config, 
+extern BOOL WCUSER_AreFontsEqual(const struct config_data* config,
                                  const LOGFONT* lf);
 extern HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd, const LOGFONT* lf);
-extern void WCUSER_FillLogFont(LOGFONT* lf, const WCHAR* name, 
+extern void WCUSER_FillLogFont(LOGFONT* lf, const WCHAR* name,
                                UINT height, UINT weight);
 
 extern void WCUSER_DumpLogFont(const char* pfx, const LOGFONT* lf, DWORD ft);
diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c
index 7f2a87d..aec56d9 100644
--- a/programs/wineconsole/wineconsole.c
+++ b/programs/wineconsole/wineconsole.c
@@ -194,7 +194,7 @@
     }
     SERVER_END_REQ;
     if (!num) {WINE_WARN("hmm renderer signaled but no events available\n"); return 1;}
-    
+
     /* FIXME: should do some event compression here (cursor pos, update) */
     /* step 1: keep only last cursor pos event */
     for (i = num - 1; i >= 0; i--)
@@ -232,7 +232,7 @@
             }
         }
     }
-   
+
     WINE_TRACE("Events:");
     for (i = 0; i < num; i++)
     {
@@ -251,7 +251,7 @@
 		h = wine_server_call_err( req ) ? 0 : (HANDLE)reply->handle;
 	    }
 	    SERVER_END_REQ;
-	    if (WINE_TRACE_ON(wineconsole)) 
+	    if (WINE_TRACE_ON(wineconsole))
                 WINE_DPRINTF(" active(%d)", (int)h);
 	    if (h)
 	    {
@@ -260,14 +260,14 @@
 	    }
 	    break;
 	case CONSOLE_RENDERER_SB_RESIZE_EVENT:
-	    if (data->curcfg.sb_width != evts[i].u.resize.width || 
+	    if (data->curcfg.sb_width != evts[i].u.resize.width ||
 		data->curcfg.sb_height != evts[i].u.resize.height)
 	    {
-		if (WINE_TRACE_ON(wineconsole)) 
+		if (WINE_TRACE_ON(wineconsole))
                     WINE_DPRINTF(" resize(%d,%d)", evts[i].u.resize.width, evts[i].u.resize.height);
 		data->curcfg.sb_width  = evts[i].u.resize.width;
 		data->curcfg.sb_height = evts[i].u.resize.height;
-		
+
 		data->cells = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, data->cells,
 					  data->curcfg.sb_width * data->curcfg.sb_height * sizeof(CHAR_INFO));
 		if (!data->cells) {WINE_ERR("OOM\n"); exit(0);}
@@ -276,28 +276,28 @@
 	    }
 	    break;
 	case CONSOLE_RENDERER_UPDATE_EVENT:
-	    if (WINE_TRACE_ON(wineconsole)) 
+	    if (WINE_TRACE_ON(wineconsole))
                 WINE_DPRINTF(" update(%d,%d)", evts[i].u.update.top, evts[i].u.update.bottom);
 	    WINECON_FetchCells(data, evts[i].u.update.top, evts[i].u.update.bottom);
 	    break;
 	case CONSOLE_RENDERER_CURSOR_POS_EVENT:
 	    if (evts[i].u.cursor_pos.x != data->cursor.X || evts[i].u.cursor_pos.y != data->cursor.Y)
-	    {	
+	    {
 		data->cursor.X = evts[i].u.cursor_pos.x;
 		data->cursor.Y = evts[i].u.cursor_pos.y;
 		data->fnPosCursor(data);
-		if (WINE_TRACE_ON(wineconsole)) 
+		if (WINE_TRACE_ON(wineconsole))
                     WINE_DPRINTF(" curs-pos(%d,%d)",evts[i].u.cursor_pos.x, evts[i].u.cursor_pos.y);
 	    }
 	    break;
 	case CONSOLE_RENDERER_CURSOR_GEOM_EVENT:
-	    if (evts[i].u.cursor_geom.size != data->curcfg.cursor_size || 
+	    if (evts[i].u.cursor_geom.size != data->curcfg.cursor_size ||
 		evts[i].u.cursor_geom.visible != data->curcfg.cursor_visible)
 	    {
-		data->fnShapeCursor(data, evts[i].u.cursor_geom.size, 
+		data->fnShapeCursor(data, evts[i].u.cursor_geom.size,
 				    evts[i].u.cursor_geom.visible, FALSE);
-		if (WINE_TRACE_ON(wineconsole)) 
-                    WINE_DPRINTF(" curs-geom(%d,%d)", 
+		if (WINE_TRACE_ON(wineconsole))
+                    WINE_DPRINTF(" curs-geom(%d,%d)",
                                  evts[i].u.cursor_geom.size, evts[i].u.cursor_geom.visible);
 	    }
 	    break;
@@ -306,20 +306,20 @@
 	    {
 		data->fnScroll(data, evts[i].u.display.left, TRUE);
 		data->fnPosCursor(data);
-		if (WINE_TRACE_ON(wineconsole)) 
+		if (WINE_TRACE_ON(wineconsole))
                     WINE_DPRINTF(" h-scroll(%d)", evts[i].u.display.left);
 	    }
 	    if (evts[i].u.display.top != data->curcfg.win_pos.Y)
 	    {
 		data->fnScroll(data, evts[i].u.display.top, FALSE);
 		data->fnPosCursor(data);
-		if (WINE_TRACE_ON(wineconsole)) 
+		if (WINE_TRACE_ON(wineconsole))
                     WINE_DPRINTF(" v-scroll(%d)", evts[i].u.display.top);
 	    }
-	    if (evts[i].u.display.width != data->curcfg.win_width || 
+	    if (evts[i].u.display.width != data->curcfg.win_width ||
 		evts[i].u.display.height != data->curcfg.win_height)
 	    {
-		if (WINE_TRACE_ON(wineconsole)) 
+		if (WINE_TRACE_ON(wineconsole))
                     WINE_DPRINTF(" win-size(%d,%d)", evts[i].u.display.width, evts[i].u.display.height);
 		data->curcfg.win_width = evts[i].u.display.width;
 		data->curcfg.win_height = evts[i].u.display.height;
@@ -439,9 +439,9 @@
      */
     if (!DuplicateHandle(GetCurrentProcess(), data->hConIn,  GetCurrentProcess(),
 			 &startup.hStdInput, GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE, TRUE, 0) ||
-	!DuplicateHandle(GetCurrentProcess(), data->hConOut, GetCurrentProcess(), 
+	!DuplicateHandle(GetCurrentProcess(), data->hConOut, GetCurrentProcess(),
 			 &startup.hStdOutput, GENERIC_READ|GENERIC_WRITE, TRUE, 0) ||
-	!DuplicateHandle(GetCurrentProcess(), data->hConOut, GetCurrentProcess(), 
+	!DuplicateHandle(GetCurrentProcess(), data->hConOut, GetCurrentProcess(),
 			     &startup.hStdError, GENERIC_READ|GENERIC_WRITE, TRUE, 0))
     {
 	WINE_ERR("Can't dup handles\n");
@@ -457,7 +457,7 @@
     while (*ptr && *ptr++ != ' ');
 
     done = *ptr && CreateProcess(NULL, ptr, NULL, NULL, TRUE, 0L, NULL, NULL, &startup, &info);
-    
+
     /* we no longer need the handles passed to the child for the console */
     CloseHandle(startup.hStdInput);
     CloseHandle(startup.hStdOutput);
diff --git a/programs/winemine/dialog.c b/programs/winemine/dialog.c
index 5525efb..b7acda3 100644
--- a/programs/winemine/dialog.c
+++ b/programs/winemine/dialog.c
@@ -1,6 +1,6 @@
 /*
  * WineMine (dialog.c)
- * 
+ *
  * Copyright 2000 Joshua Thielen <jt85296@ltu.edu>
  *
  * This library is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@
         SetDlgItemInt( hDlg, IDC_EDITCOLS, p_board->cols, FALSE );
         SetDlgItemInt( hDlg, IDC_EDITMINES, p_board->mines, FALSE );
         return TRUE;
-    
+
     case WM_COMMAND:
         switch( LOWORD( wParam ) ) {
         case IDOK:
@@ -45,13 +45,13 @@
             CheckLevel( p_board );
             EndDialog( hDlg, 0 );
             return TRUE;
-        
+
         case IDCANCEL:
             EndDialog( hDlg, 0 );
             return TRUE;
         }
         break;
-    }     
+    }
     return FALSE;
 }
 
@@ -65,22 +65,22 @@
         SetDlgItemText( hDlg, IDC_EDITNAME,
                 p_board->best_name[p_board->difficulty] );
         return TRUE;
-    
+
     case WM_COMMAND:
         switch( LOWORD( wParam ) ) {
         case IDOK:
-            GetDlgItemText( hDlg, IDC_EDITNAME, 
+            GetDlgItemText( hDlg, IDC_EDITNAME,
                 p_board->best_name[p_board->difficulty],
                 sizeof( p_board->best_name[p_board->difficulty] ) );
             EndDialog( hDlg, 0 );
             return TRUE;
-    
+
         case IDCANCEL:
             EndDialog( hDlg, 0 );
             return TRUE;
         }
         break;
-    }     
+    }
     return FALSE;
 }
 
@@ -96,12 +96,12 @@
         /* set best names */
         for( i = 0; i < 3; i++ )
             SetDlgItemText( hDlg, (IDC_NAME1) + i, p_board->best_name[i] );
-    
+
     	/* set best times */
         for( i = 0; i < 3; i++ )
             SetDlgItemInt( hDlg, (IDC_TIME1) + i, p_board->best_time[i], FALSE );
         return TRUE;
-    
+
     case WM_COMMAND:
         switch( LOWORD( wParam ) ) {
         case IDOK:
@@ -109,7 +109,7 @@
             return TRUE;
         }
         break;
-    }     
+    }
     return FALSE;
 }
 
@@ -118,7 +118,7 @@
     switch( uMsg ) {
     case WM_INITDIALOG:
         return TRUE;
-    
+
     case WM_COMMAND:
         switch( LOWORD( wParam ) ) {
         case IDOK:
diff --git a/programs/winemine/dialog.h b/programs/winemine/dialog.h
index e40bf64..b4e0fc4 100644
--- a/programs/winemine/dialog.h
+++ b/programs/winemine/dialog.h
@@ -1,6 +1,6 @@
 /*
  * WineMine (dialog.h)
- * 
+ *
  * Copyright 2000 Joshua Thielen <jt85296@ltu.edu>
  *
  * This library is free software; you can redistribute it and/or
diff --git a/programs/winemine/main.c b/programs/winemine/main.c
index 62c253a..38f26a6 100644
--- a/programs/winemine/main.c
+++ b/programs/winemine/main.c
@@ -1,6 +1,6 @@
 /*
  * WineMine (main.c)
- * 
+ *
  * Copyright 2000 Joshua Thielen <jt85296@ltu.edu>
  *
  * This library is free software; you can redistribute it and/or
@@ -37,15 +37,15 @@
 #include <stdio.h>
 #define DEBUG(x) fprintf(stderr,x)
 #else
-#define DEBUG(x) 
+#define DEBUG(x)
 #endif
 
 int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow )
-{ 
+{
     MSG msg;
     WNDCLASS wc;
     HWND hWnd;
-    HACCEL haccel;        
+    HACCEL haccel;
     char appname[9];
 
     LoadString( hInst, IDS_APPNAME, appname, sizeof(appname));
@@ -60,15 +60,15 @@
     wc.hbrBackground = (HBRUSH) GetStockObject( BLACK_BRUSH );
     wc.lpszMenuName = "MENU_WINEMINE";
     wc.lpszClassName = appname;
-    
+
     if (!RegisterClass(&wc)) exit(1);
-    hWnd = CreateWindow( appname, appname, 
-        WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX, 
-        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 
+    hWnd = CreateWindow( appname, appname,
+        WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX,
+        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
         NULL_HANDLE, NULL_HANDLE, hInst, NULL );
-    
+
     if (!hWnd) exit(1);
-    
+
     ShowWindow( hWnd, cmdshow );
     UpdateWindow( hWnd );
 
@@ -78,7 +78,7 @@
     while( GetMessage(&msg, NULL_HANDLE, 0, 0) ) {
         if (!TranslateAccelerator( hWnd, haccel, &msg ))
             TranslateMessage( &msg );
-        
+
         DispatchMessage( &msg );
     }
     return msg.wParam;
@@ -88,11 +88,11 @@
 {
     HDC hdc;
     PAINTSTRUCT ps;
-    HMENU hMenu;        
-    static BOARD board;     
+    HMENU hMenu;
+    static BOARD board;
 
     switch( msg ) {
-    case WM_CREATE:         
+    case WM_CREATE:
         board.hInst = ((LPCREATESTRUCT) lParam)->hInstance;
         board.hWnd = hWnd;
         InitBoard( &board );
@@ -118,27 +118,27 @@
     case WM_MOVE:
         DEBUG("WM_MOVE\n");
         board.pos.x = (unsigned) LOWORD(lParam);
-        board.pos.y = (unsigned) HIWORD(lParam);    
+        board.pos.y = (unsigned) HIWORD(lParam);
         return 0;
 
     case WM_DESTROY:
         SaveBoard( &board );
-        DestroyBoard( &board ); 
+        DestroyBoard( &board );
         PostQuitMessage( 0 );
         return 0;
-    
+
     case WM_TIMER:
         if( board.status == PLAYING ) {
             board.time++;
-                  RedrawWindow( hWnd, &board.timer_rect, NULL_HANDLE, 
-                    RDW_INVALIDATE | RDW_UPDATENOW );      
+                  RedrawWindow( hWnd, &board.timer_rect, NULL_HANDLE,
+                    RDW_INVALIDATE | RDW_UPDATENOW );
         }
         return 0;
 
     case WM_LBUTTONDOWN:
         DEBUG("WM_LBUTTONDOWN\n");
         if( wParam & MK_RBUTTON )
-            msg = WM_MBUTTONDOWN;        
+            msg = WM_MBUTTONDOWN;
         TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg );
         SetCapture( hWnd );
         return 0;
@@ -146,25 +146,25 @@
     case WM_LBUTTONUP:
         DEBUG("WM_LBUTTONUP\n");
         if( wParam & MK_RBUTTON )
-            msg = WM_MBUTTONUP;    
+            msg = WM_MBUTTONUP;
         TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg );
         ReleaseCapture();
         return 0;
 
     case WM_RBUTTONDOWN:
         DEBUG("WM_RBUTTONDOWN\n");
-        if( wParam & MK_LBUTTON ) {    
+        if( wParam & MK_LBUTTON ) {
             board.press.x = 0;
-            board.press.y = 0;    
+            board.press.y = 0;
             msg = WM_MBUTTONDOWN;
-        }    
+        }
         TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg );
         return 0;
 
     case WM_RBUTTONUP:
         DEBUG("WM_RBUTTONUP\n");
-        if( wParam & MK_LBUTTON ) 
-            msg = WM_MBUTTONUP;    
+        if( wParam & MK_LBUTTON )
+            msg = WM_MBUTTONUP;
         TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam), msg );
         return 0;
 
@@ -192,8 +192,8 @@
 
         TestBoard( hWnd, &board, LOWORD(lParam), HIWORD(lParam),  msg );
 
-        return 0;    
-    } 
+        return 0;
+    }
 
     case WM_COMMAND:
         switch(LOWORD(wParam)) {
@@ -202,26 +202,26 @@
             return 0;
 
         case IDM_MARKQ:
-            hMenu = GetMenu( hWnd );     
+            hMenu = GetMenu( hWnd );
             board.IsMarkQ = !board.IsMarkQ;
             if( board.IsMarkQ )
                 CheckMenuItem( hMenu, IDM_MARKQ, MF_CHECKED );
-            else 
+            else
                 CheckMenuItem( hMenu, IDM_MARKQ, MF_UNCHECKED );
             return 0;
 
         case IDM_BEGINNER:
-            SetDifficulty( &board, BEGINNER );    
+            SetDifficulty( &board, BEGINNER );
             CreateBoard( &board );
             return 0;
 
         case IDM_ADVANCED:
-            SetDifficulty( &board, ADVANCED );    
+            SetDifficulty( &board, ADVANCED );
             CreateBoard( &board );
             return 0;
 
         case IDM_EXPERT:
-            SetDifficulty( &board, EXPERT );    
+            SetDifficulty( &board, EXPERT );
             CreateBoard( &board );
             return 0;
 
@@ -235,7 +235,7 @@
             return 0;
 
         case IDM_TIMES:
-            DialogBoxParam( board.hInst, "DLG_TIMES", hWnd, 
+            DialogBoxParam( board.hInst, "DLG_TIMES", hWnd,
                     TimesDlgProc, (LPARAM) &board);
             return 0;
 
@@ -246,7 +246,7 @@
             DEBUG("Unknown WM_COMMAND command message received\n");
             break;
         }
-    } 
+    }
     return( DefWindowProc( hWnd, msg, wParam, lParam ));
 }
 
@@ -256,16 +256,16 @@
 
     p_board->hMinesBMP = LoadBitmap( p_board->hInst, "mines");
     p_board->hFacesBMP = LoadBitmap( p_board->hInst, "faces");
-    p_board->hLedsBMP = LoadBitmap( p_board->hInst, "leds");     
-    
-    LoadBoard( p_board );    
-    
+    p_board->hLedsBMP = LoadBitmap( p_board->hInst, "leds");
+
+    LoadBoard( p_board );
+
     if( p_board->pos.x < (unsigned) GetSystemMetrics( SM_CXFIXEDFRAME ))
         p_board->pos.x = GetSystemMetrics( SM_CXFIXEDFRAME );
 
-    if( p_board->pos.x > (unsigned) (GetSystemMetrics( SM_CXSCREEN ) 
+    if( p_board->pos.x > (unsigned) (GetSystemMetrics( SM_CXSCREEN )
     - GetSystemMetrics( SM_CXFIXEDFRAME ))) {
-        p_board->pos.x = GetSystemMetrics( SM_CXSCREEN ) 
+        p_board->pos.x = GetSystemMetrics( SM_CXSCREEN )
         - GetSystemMetrics( SM_CXFIXEDFRAME );
     }
 
@@ -277,23 +277,23 @@
         GetSystemMetrics( SM_CYFIXEDFRAME );
     }
 
-    if( p_board->pos.y > (unsigned) (GetSystemMetrics( SM_CYSCREEN ) 
+    if( p_board->pos.y > (unsigned) (GetSystemMetrics( SM_CYSCREEN )
     - GetSystemMetrics( SM_CYFIXEDFRAME ))) {
         p_board->pos.y = GetSystemMetrics( SM_CYSCREEN )
         - GetSystemMetrics( SM_CYFIXEDFRAME );
     }
-    
+
     hMenu = GetMenu( p_board->hWnd );
-    CheckMenuItem( hMenu, IDM_BEGINNER + (unsigned) p_board->difficulty, 
+    CheckMenuItem( hMenu, IDM_BEGINNER + (unsigned) p_board->difficulty,
             MF_CHECKED );
     if( p_board->IsMarkQ )
         CheckMenuItem( hMenu, IDM_MARKQ, MF_CHECKED );
-    else 
+    else
         CheckMenuItem( hMenu, IDM_MARKQ, MF_UNCHECKED );
     CheckLevel( p_board );
 }
 
-void LoadBoard( BOARD *p_board ) 
+void LoadBoard( BOARD *p_board )
 {
     DWORD size;
     DWORD type;
@@ -303,80 +303,80 @@
     unsigned i;
 
 
-    RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\Wine\\WineMine", 
+    RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\Wine\\WineMine",
             0, KEY_QUERY_VALUE, &hkey );
-    
+
     size = sizeof( data );
-    if( RegQueryValueEx( hkey, "Xpos", NULL, (LPDWORD) &type, 
+    if( RegQueryValueEx( hkey, "Xpos", NULL, (LPDWORD) &type,
             (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS ) {
         p_board->pos.x = atoi( data );
     }
-    else 
+    else
         p_board->pos.x = GetSystemMetrics( SM_CXFIXEDFRAME );
 
     size = sizeof( data );
-    if( RegQueryValueEx( hkey, "Ypos", NULL, (LPDWORD) &type, 
+    if( RegQueryValueEx( hkey, "Ypos", NULL, (LPDWORD) &type,
             (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS )
         p_board->pos.y = atoi( data );
-    else 
+    else
         p_board->pos.y = GetSystemMetrics( SM_CYMENU )
-        + GetSystemMetrics( SM_CYCAPTION ) 
+        + GetSystemMetrics( SM_CYCAPTION )
         + GetSystemMetrics( SM_CYFIXEDFRAME );
 
     size = sizeof( data );
-    if( RegQueryValueEx( hkey, "Rows", NULL, (LPDWORD) &type, 
+    if( RegQueryValueEx( hkey, "Rows", NULL, (LPDWORD) &type,
             (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS )
         p_board->rows = atoi( data );
     else
         p_board->rows = BEGINNER_ROWS;
 
     size = sizeof( data );
-    if( RegQueryValueEx( hkey, "Cols", NULL, (LPDWORD) &type, 
+    if( RegQueryValueEx( hkey, "Cols", NULL, (LPDWORD) &type,
             (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS )
         p_board->cols = atoi( data );
     else
-        p_board->cols = BEGINNER_COLS;    
-    
+        p_board->cols = BEGINNER_COLS;
+
     size = sizeof( data );
-    if( RegQueryValueEx( hkey, "Mines", NULL, (LPDWORD) &type, 
+    if( RegQueryValueEx( hkey, "Mines", NULL, (LPDWORD) &type,
             (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS )
         p_board->mines = atoi( data );
-    else 
+    else
         p_board->rows = BEGINNER_ROWS;
 
     size = sizeof( data );
-    if( RegQueryValueEx( hkey, "Difficulty", NULL, (LPDWORD) &type, 
+    if( RegQueryValueEx( hkey, "Difficulty", NULL, (LPDWORD) &type,
             (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS )
         p_board->difficulty = (DIFFICULTY) atoi( data );
-    else 
+    else
         p_board->difficulty = BEGINNER;
 
     size = sizeof( data );
-    if( RegQueryValueEx( hkey, "MarkQ", NULL, (LPDWORD) &type, 
+    if( RegQueryValueEx( hkey, "MarkQ", NULL, (LPDWORD) &type,
             (LPBYTE) data, (LPDWORD) &size ) == ERROR_SUCCESS )
         p_board->IsMarkQ = atoi( data );
-    else 
+    else
         p_board->IsMarkQ = TRUE;
-        
+
     for( i = 0; i < 3; i++ ) {
         wsprintf( key_name, "Name%d", i );
         size = sizeof( data );
-        if( RegQueryValueEx( hkey, key_name, NULL, (LPDWORD) &type, 
-                (LPBYTE) data, 
+        if( RegQueryValueEx( hkey, key_name, NULL, (LPDWORD) &type,
+                (LPBYTE) data,
                 (LPDWORD) &size ) == ERROR_SUCCESS )
                     strncpy( p_board->best_name[i], data, sizeof( data ) );
-        else 
+        else
             wsprintf( p_board->best_name[i], "Nobody");
     }
-    
+
     for( i = 0; i < 3; i++ ) {
         wsprintf( key_name, "Time%d", i );
         size = sizeof( data );
-        if( RegQueryValueEx( hkey, key_name, NULL, (LPDWORD) &type, 
-                (LPBYTE) data, 
+        if( RegQueryValueEx( hkey, key_name, NULL, (LPDWORD) &type,
+                (LPBYTE) data,
                 (LPDWORD) &size ) == ERROR_SUCCESS )
             p_board->best_time[i] = atoi( data );
-        else 
+        else
             p_board->best_time[i] = 999;
     }
     RegCloseKey( hkey );
@@ -390,12 +390,12 @@
     unsigned i;
     char data[16];
     char key_name[8];
-    
-    if( RegCreateKeyEx( HKEY_LOCAL_MACHINE, 
+
+    if( RegCreateKeyEx( HKEY_LOCAL_MACHINE,
                 "Software\\Wine\\WineMine", 0, NULL,
-                REG_OPTION_NON_VOLATILE, KEY_WRITE, &sa, 
+                REG_OPTION_NON_VOLATILE, KEY_WRITE, &sa,
                 &hkey, &disp ) != ERROR_SUCCESS)
-        return;    
+        return;
 
     wsprintf( data, "%d", p_board->pos.x );
     RegSetValueEx( hkey, "Xpos", 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
@@ -444,17 +444,17 @@
     HMENU hMenu = GetMenu( p_board->hWnd );
 
     CheckMenuItem( hMenu, IDM_BEGINNER + p_board->difficulty, MF_UNCHECKED );
-    p_board->difficulty = difficulty; 
+    p_board->difficulty = difficulty;
     CheckMenuItem( hMenu, IDM_BEGINNER + difficulty, MF_CHECKED );
-    
+
     switch( difficulty ) {
-    case BEGINNER:    
+    case BEGINNER:
         p_board->cols = BEGINNER_COLS;
         p_board->rows = BEGINNER_ROWS;
         p_board->mines = BEGINNER_MINES;
         break;
 
-    case ADVANCED:    
+    case ADVANCED:
         p_board->cols = ADVANCED_COLS;
         p_board->rows = ADVANCED_ROWS;
         p_board->mines = ADVANCED_MINES;
@@ -463,13 +463,13 @@
     case EXPERT:
         p_board->cols = EXPERT_COLS;
         p_board->rows = EXPERT_ROWS;
-        p_board->mines = EXPERT_MINES;        
-        break;    
+        p_board->mines = EXPERT_MINES;
+        break;
 
     case CUSTOM:
-        DialogBoxParam( p_board->hInst, "DLG_CUSTOM", p_board->hWnd, 
+        DialogBoxParam( p_board->hInst, "DLG_CUSTOM", p_board->hWnd,
                 CustomDlgProc, (LPARAM) p_board);
-        break;    
+        break;
     }
 }
 
@@ -480,59 +480,59 @@
     p_board->mb = MB_NONE;
     p_board->boxes_left = p_board->cols * p_board->rows - p_board->mines;
     p_board->num_flags = 0;
-    
+
     CreateBoxes( p_board );
 
     p_board->width = p_board->cols * MINE_WIDTH + BOARD_WMARGIN * 2;
-    
-    p_board->height = p_board->rows * MINE_HEIGHT + LED_HEIGHT 
+
+    p_board->height = p_board->rows * MINE_HEIGHT + LED_HEIGHT
         + BOARD_HMARGIN * 3;
 
     wnd_x = p_board->pos.x - GetSystemMetrics( SM_CXFIXEDFRAME );
-    wnd_y = p_board->pos.y - GetSystemMetrics( SM_CYMENU ) 
-        - GetSystemMetrics( SM_CYCAPTION ) 
+    wnd_y = p_board->pos.y - GetSystemMetrics( SM_CYMENU )
+        - GetSystemMetrics( SM_CYCAPTION )
         - GetSystemMetrics( SM_CYFIXEDFRAME );
-    wnd_width = p_board->width 
+    wnd_width = p_board->width
         + GetSystemMetrics( SM_CXFIXEDFRAME ) * 2;
-    wnd_height = p_board->height 
-        + GetSystemMetrics( SM_CYMENU ) 
-        + GetSystemMetrics( SM_CYCAPTION ) 
+    wnd_height = p_board->height
+        + GetSystemMetrics( SM_CYMENU )
+        + GetSystemMetrics( SM_CYCAPTION )
         + GetSystemMetrics( SM_CYFIXEDFRAME ) * 2;
 
-    /* setting the mines rectangle boundary */    
-    left = BOARD_WMARGIN; 
-    top = BOARD_HMARGIN * 2 + LED_HEIGHT; 
+    /* setting the mines rectangle boundary */
+    left = BOARD_WMARGIN;
+    top = BOARD_HMARGIN * 2 + LED_HEIGHT;
     right = left + p_board->cols * MINE_WIDTH;
     bottom = top + p_board->rows * MINE_HEIGHT;
     SetRect( &p_board->mines_rect, left, top, right, bottom );
 
-    /* setting the face rectangle boundary */    
+    /* setting the face rectangle boundary */
     left = p_board->width / 2 - FACE_WIDTH / 2;
     top = BOARD_HMARGIN;
     right = left + FACE_WIDTH;
-    bottom = top + FACE_HEIGHT; 
+    bottom = top + FACE_HEIGHT;
     SetRect( &p_board->face_rect, left, top, right, bottom );
-    
-    /* setting the timer rectangle boundary */    
+
+    /* setting the timer rectangle boundary */
     left = BOARD_WMARGIN;
     top = BOARD_HMARGIN;
     right = left + LED_WIDTH * 3;
-    bottom = top + LED_HEIGHT; 
+    bottom = top + LED_HEIGHT;
     SetRect( &p_board->timer_rect, left, top, right, bottom );
-        
-    /* setting the counter rectangle boundary */    
+
+    /* setting the counter rectangle boundary */
     left =  p_board->width - BOARD_WMARGIN - LED_WIDTH * 3;
     top = BOARD_HMARGIN;
     right = p_board->width - BOARD_WMARGIN;
-    bottom = top + LED_HEIGHT; 
+    bottom = top + LED_HEIGHT;
     SetRect( &p_board->counter_rect, left, top, right, bottom );
-        
+
     p_board->status = WAITING;
-    p_board->face_bmp = SMILE_BMP;     
+    p_board->face_bmp = SMILE_BMP;
     p_board->time = 0;
 
     MoveWindow( p_board->hWnd, wnd_x, wnd_y, wnd_width, wnd_height, TRUE );
-    RedrawWindow( p_board->hWnd, NULL, NULL_HANDLE, 
+    RedrawWindow( p_board->hWnd, NULL, NULL_HANDLE,
             RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE );
 }
 
@@ -544,7 +544,7 @@
 
     if( p_board->rows > MAX_ROWS )
         p_board->rows = MAX_ROWS;
-        
+
     if( p_board->cols < BEGINNER_COLS )
         p_board->cols = BEGINNER_COLS;
 
@@ -552,10 +552,10 @@
         p_board->cols = MAX_COLS;
 
     if( p_board->mines < BEGINNER_MINES )
-        p_board->mines = BEGINNER_MINES;               
+        p_board->mines = BEGINNER_MINES;
 
-    if( p_board->mines > p_board->cols * p_board->rows - 1 ) 
-        p_board->mines = p_board->cols * p_board->rows - 1; 
+    if( p_board->mines > p_board->cols * p_board->rows - 1 )
+        p_board->mines = p_board->cols * p_board->rows - 1;
 }
 
 
@@ -566,14 +566,14 @@
 
     srand( (unsigned) time( NULL ) );
 
-    /* Create the boxes...  
+    /* Create the boxes...
      * We actually create them with an empty border,
      * so special care doesn't have to be taken on the edges
      */
-    
+
     for( col = 0; col <= p_board->cols + 1; col++ )
       for( row = 0; row <= p_board->rows + 1; row++ ) {
-        p_board->box[col][row].IsPressed = FALSE;  
+        p_board->box[col][row].IsPressed = FALSE;
         p_board->box[col][row].IsMine = FALSE;
         p_board->box[col][row].FlagType = NORMAL;
         p_board->box[col][row].NumMines = 0;
@@ -613,9 +613,9 @@
     unsigned col, row;
     hOldObj = SelectObject (hMemDC, p_board->hMinesBMP);
 
-    for( row = 1; row <= p_board->rows; row++ ) { 
+    for( row = 1; row <= p_board->rows; row++ ) {
       for( col = 1; col <= p_board->cols; col++ ) {
-        DrawMine( hdc, hMemDC, p_board, col, row, FALSE );    
+        DrawMine( hdc, hMemDC, p_board, col, row, FALSE );
       }
     }
     SelectObject( hMemDC, hOldObj );
@@ -626,7 +626,7 @@
     MINEBMP_OFFSET offset = BOX_BMP;
 
     if( col == 0 || col > p_board->cols || row == 0 || row > p_board->rows )
-           return;    
+           return;
 
     if( p_board->status == GAMEOVER ) {
         if( p_board->box[col][row].IsMine ) {
@@ -635,60 +635,60 @@
                 offset = FLAG_BMP;
                 break;
             case COMPLETE:
-                offset = EXPLODE_BMP;                        
+                offset = EXPLODE_BMP;
                 break;
             case NORMAL:
                 offset = MINE_BMP;
             }
         } else {
-            switch( p_board->box[col][row].FlagType ) {    
+            switch( p_board->box[col][row].FlagType ) {
             case QUESTION:
-                offset = QUESTION_BMP;     
+                offset = QUESTION_BMP;
                 break;
             case FLAG:
                 offset = WRONG_BMP;
                 break;
-            case NORMAL:    
+            case NORMAL:
                 offset = BOX_BMP;
                 break;
             case COMPLETE:
                 /* Do nothing */
                 break;
             default:
-                DEBUG("Unknown FlagType during game over in DrawMine\n"); 
+                DEBUG("Unknown FlagType during game over in DrawMine\n");
                 break;
             }
-        } 
+        }
     } else {    /* WAITING or PLAYING */
         switch( p_board->box[col][row].FlagType ) {
         case QUESTION:
-            if( !IsPressed )    
-                offset = QUESTION_BMP;     
+            if( !IsPressed )
+                offset = QUESTION_BMP;
             else
-                offset = QPRESS_BMP;    
+                offset = QPRESS_BMP;
             break;
         case FLAG:
             offset = FLAG_BMP;
             break;
-        case NORMAL:    
+        case NORMAL:
             if( !IsPressed )
                 offset = BOX_BMP;
-            else 
+            else
                 offset = MPRESS_BMP;
             break;
         case COMPLETE:
             /* Do nothing */
             break;
         default:
-            DEBUG("Unknown FlagType while playing in DrawMine\n"); 
+            DEBUG("Unknown FlagType while playing in DrawMine\n");
             break;
         }
-    } 
+    }
 
-    if( p_board->box[col][row].FlagType == COMPLETE  
+    if( p_board->box[col][row].FlagType == COMPLETE
         && !p_board->box[col][row].IsMine )
           offset = (MINEBMP_OFFSET) p_board->box[col][row].NumMines;
-    
+
     BitBlt( hdc,
             (col - 1) * MINE_WIDTH + p_board->mines_rect.left,
             (row - 1) * MINE_HEIGHT + p_board->mines_rect.top,
@@ -700,7 +700,7 @@
 {
     HGDIOBJ hOldObj;
     unsigned led[3], i;
-    int count;     
+    int count;
 
     count = number;
     if( count < 1000 ) {
@@ -724,8 +724,8 @@
     /* use unlit led if not playing */
     if( p_board->status == WAITING )
         for( i = 0; i < 3; i++ )
-            led[i] = 11;  
-    
+            led[i] = 11;
+
     hOldObj = SelectObject (hMemDC, p_board->hLedsBMP);
 
     for( i = 0; i < 3; i++ ) {
@@ -734,19 +734,19 @@
             y,
             LED_WIDTH,
             LED_HEIGHT,
-            hMemDC, 
-            0, 
-            led[i] * LED_HEIGHT, 
+            hMemDC,
+            0,
+            led[i] * LED_HEIGHT,
             SRCCOPY);
     }
-    
+
     SelectObject( hMemDC, hOldObj );
 }
 
 
 void DrawFace( HDC hdc, HDC hMemDC, BOARD *p_board )
 {
-    HGDIOBJ hOldObj; 
+    HGDIOBJ hOldObj;
 
     hOldObj = SelectObject (hMemDC, p_board->hFacesBMP);
 
@@ -756,96 +756,96 @@
         FACE_WIDTH,
         FACE_HEIGHT,
         hMemDC, 0, p_board->face_bmp * FACE_HEIGHT, SRCCOPY);
-    
+
     SelectObject( hMemDC, hOldObj );
 }
 
 
 void DrawBoard( HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, BOARD *p_board )
 {
-    RECT tmp_rect;    
-    
-    if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->counter_rect ) )    
+    RECT tmp_rect;
+
+    if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->counter_rect ) )
         DrawLeds( hdc, hMemDC, p_board, p_board->mines - p_board->num_flags,
                   p_board->counter_rect.left,
                   p_board->counter_rect.top );
 
-    if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->timer_rect ) )    
+    if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->timer_rect ) )
         DrawLeds( hdc, hMemDC, p_board, p_board->time,
-                  p_board->timer_rect.left, 
+                  p_board->timer_rect.left,
                   p_board->timer_rect.top );
-    
-    if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->face_rect ) )    
+
+    if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->face_rect ) )
         DrawFace( hdc, hMemDC, p_board );
-    
-    if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->mines_rect ) )    
+
+    if( IntersectRect( &tmp_rect, &ps->rcPaint, &p_board->mines_rect ) )
         DrawMines( hdc, hMemDC, p_board );
-}    
+}
 
 
 void TestBoard( HWND hWnd, BOARD *p_board, unsigned x, unsigned y, int msg )
 {
     POINT pt;
-    
+
     pt.x = x;
     pt.y = y;
 
     if( PtInRect( &p_board->mines_rect, pt ) && p_board->status != GAMEOVER
-    && p_board->status != WON ) 
+    && p_board->status != WON )
         TestMines( p_board, pt, msg );
     else {
-        UnpressBoxes( p_board, 
-            p_board->press.x, 
-            p_board->press.y );    
+        UnpressBoxes( p_board,
+            p_board->press.x,
+            p_board->press.y );
         p_board->press.x = 0;
         p_board->press.y = 0;
     }
 
     if( p_board->boxes_left == 0 ) {
         p_board->status = WON;
-       
+
         if( p_board->difficulty != CUSTOM &&
                     p_board->time < p_board->best_time[p_board->difficulty] ) {
             p_board->best_time[p_board->difficulty] = p_board->time;
-        
-            DialogBoxParam( p_board->hInst, "DLG_CONGRATS", hWnd, 
+
+            DialogBoxParam( p_board->hInst, "DLG_CONGRATS", hWnd,
                     CongratsDlgProc, (LPARAM) p_board);
-    
-            DialogBoxParam( p_board->hInst, "DLG_TIMES", hWnd, 
+
+            DialogBoxParam( p_board->hInst, "DLG_TIMES", hWnd,
                     TimesDlgProc, (LPARAM) p_board);
         }
     }
-    TestFace( p_board, pt, msg );    
+    TestFace( p_board, pt, msg );
 }
 
 void TestMines( BOARD *p_board, POINT pt, int msg )
 {
     BOOL draw = TRUE;
-    unsigned col, row;    
+    unsigned col, row;
 
     col = (pt.x - p_board->mines_rect.left) / MINE_WIDTH + 1;
     row = (pt.y - p_board->mines_rect.top ) / MINE_HEIGHT + 1;
-    
+
     switch ( msg ) {
     case WM_LBUTTONDOWN:
         if( p_board->press.x != col || p_board->press.y != row ) {
-            UnpressBox( p_board, 
+            UnpressBox( p_board,
                     p_board->press.x, p_board->press.y );
             p_board->press.x = col;
             p_board->press.y = row;
-            PressBox( p_board, col, row );    
-        }    
-        draw = FALSE;    
+            PressBox( p_board, col, row );
+        }
+        draw = FALSE;
         break;
 
     case WM_LBUTTONUP:
         if( p_board->press.x != col || p_board->press.y != row )
-            UnpressBox( p_board, 
+            UnpressBox( p_board,
                     p_board->press.x, p_board->press.y );
         p_board->press.x = 0;
         p_board->press.y = 0;
         if( p_board->box[col][row].FlagType != FLAG )
-            p_board->status = PLAYING;    
+            p_board->status = PLAYING;
         CompleteBox( p_board, col, row );
         break;
 
@@ -856,7 +856,7 @@
 
     case WM_MBUTTONUP:
         if( p_board->press.x != col || p_board->press.y != row )
-            UnpressBoxes( p_board, 
+            UnpressBoxes( p_board,
                     p_board->press.x, p_board->press.y );
         p_board->press.x = 0;
         p_board->press.y = 0;
@@ -865,7 +865,7 @@
 
     case WM_RBUTTONDOWN:
         AddFlag( p_board, col, row );
-        p_board->status = PLAYING;    
+        p_board->status = PLAYING;
         break;
     default:
         DEBUG("Unknown message type received in TestMines\n");
@@ -874,10 +874,10 @@
 
     if( draw )
     {
-        RedrawWindow( p_board->hWnd, NULL, NULL_HANDLE, 
+        RedrawWindow( p_board->hWnd, NULL, NULL_HANDLE,
             RDW_INVALIDATE | RDW_UPDATENOW );
     }
-}    
+}
 
 
 void TestFace( BOARD *p_board, POINT pt, int msg )
@@ -887,20 +887,20 @@
             p_board->face_bmp = OOH_BMP;
         else p_board->face_bmp = SMILE_BMP;
     }
-    else if( p_board->status == GAMEOVER ) 
+    else if( p_board->status == GAMEOVER )
         p_board->face_bmp = DEAD_BMP;
-    else if( p_board->status == WON ) 
+    else if( p_board->status == WON )
             p_board->face_bmp = COOL_BMP;
 
-    if( PtInRect( &p_board->face_rect, pt ) ) {        
-        if( msg == WM_LBUTTONDOWN )     
+    if( PtInRect( &p_board->face_rect, pt ) ) {
+        if( msg == WM_LBUTTONDOWN )
             p_board->face_bmp = SPRESS_BMP;
-        
-        if( msg == WM_LBUTTONUP )     
-            CreateBoard( p_board );    
+
+        if( msg == WM_LBUTTONUP )
+            CreateBoard( p_board );
     }
 
-    RedrawWindow( p_board->hWnd, &p_board->face_rect, NULL_HANDLE, 
+    RedrawWindow( p_board->hWnd, &p_board->face_rect, NULL_HANDLE,
         RDW_INVALIDATE | RDW_UPDATENOW );
 }
 
@@ -909,26 +909,26 @@
 {
     int i, j;
 
-    if( p_board->box[col][row].FlagType != COMPLETE && 
-            p_board->box[col][row].FlagType != FLAG && 
-            col > 0 && col < p_board->cols + 1 && 
+    if( p_board->box[col][row].FlagType != COMPLETE &&
+            p_board->box[col][row].FlagType != FLAG &&
+            col > 0 && col < p_board->cols + 1 &&
             row > 0 && row < p_board->rows + 1 ) {
         p_board->box[col][row].FlagType = COMPLETE;
-    
+
         if( p_board->box[col][row].IsMine ) {
-            p_board->face_bmp = DEAD_BMP; 
+            p_board->face_bmp = DEAD_BMP;
             p_board->status = GAMEOVER;
         }
-        else if( p_board->status != GAMEOVER ) 
+        else if( p_board->status != GAMEOVER )
             p_board->boxes_left--;
 
-        if( p_board->box[col][row].NumMines == 0 ) 
+        if( p_board->box[col][row].NumMines == 0 )
         {
             for( i = -1; i <= 1; i++ )
             for( j = -1; j <= 1; j++ )
                 CompleteBox( p_board, col + i, row + j  );
         }
-    } 
+    }
 }
 
 
@@ -940,14 +940,14 @@
     if( p_board->box[col][row].FlagType == COMPLETE ) {
         for( i = -1; i <= 1; i++ )
           for( j = -1; j <= 1; j++ ) {
-            if( p_board->box[col+i][row+j].FlagType == FLAG ) 
+            if( p_board->box[col+i][row+j].FlagType == FLAG )
                 numFlags++;
           }
-    
+
         if( numFlags == p_board->box[col][row].NumMines ) {
             for( i = -1; i <= 1; i++ )
               for( j = -1; j <= 1; j++ ) {
-                if( p_board->box[col+i][row+j].FlagType != FLAG ) 
+                if( p_board->box[col+i][row+j].FlagType != FLAG )
                     CompleteBox( p_board, col+i, row+j );
               }
         }
@@ -962,7 +962,7 @@
         case FLAG:
             if( p_board->IsMarkQ )
                 p_board->box[col][row].FlagType = QUESTION;
-            else 
+            else
                 p_board->box[col][row].FlagType = NORMAL;
             p_board->num_flags--;
             break;
@@ -970,19 +970,19 @@
         case QUESTION:
             p_board->box[col][row].FlagType = NORMAL;
             break;
-        
+
         default:
             p_board->box[col][row].FlagType = FLAG;
             p_board->num_flags++;
-        }    
-    }    
+        }
+    }
 }
 
 
 void PressBox( BOARD *p_board, unsigned col, unsigned row )
 {
-    HDC hdc;      
-    HGDIOBJ hOldObj; 
+    HDC hdc;
+    HGDIOBJ hOldObj;
     HDC hMemDC;
 
     hdc = GetDC( p_board->hWnd );
@@ -991,7 +991,7 @@
 
     DrawMine( hdc, hMemDC, p_board, col, row, TRUE );
 
-    SelectObject( hMemDC, hOldObj ); 
+    SelectObject( hMemDC, hOldObj );
     DeleteDC( hMemDC );
     ReleaseDC( p_board->hWnd, hdc );
 }
@@ -1003,31 +1003,31 @@
 
     for( i = -1; i <= 1; i++ )
       for( j = -1; j <= 1; j++ ) {
-        p_board->box[col + i][row + j].IsPressed = TRUE;    
+        p_board->box[col + i][row + j].IsPressed = TRUE;
         PressBox( p_board, col + i, row + j );
     }
 
     for( i = -1; i <= 1; i++ )
       for( j = -1; j <= 1; j++ ) {
-        if( !p_board->box[p_board->press.x + i][p_board->press.y + j].IsPressed )    
+        if( !p_board->box[p_board->press.x + i][p_board->press.y + j].IsPressed )
             UnpressBox( p_board, p_board->press.x + i, p_board->press.y + j );
     }
 
     for( i = -1; i <= 1; i++ )
       for( j = -1; j <= 1; j++ ) {
-        p_board->box[col + i][row + j].IsPressed = FALSE;    
+        p_board->box[col + i][row + j].IsPressed = FALSE;
         PressBox( p_board, col + i, row + j );
     }
 
     p_board->press.x = col;
-    p_board->press.y = row;    
+    p_board->press.y = row;
 }
 
 
 void UnpressBox( BOARD *p_board, unsigned col, unsigned row )
 {
-    HDC hdc; 
-    HGDIOBJ hOldObj; 
+    HDC hdc;
+    HGDIOBJ hOldObj;
     HDC hMemDC;
 
     hdc = GetDC( p_board->hWnd );
@@ -1036,7 +1036,7 @@
 
     DrawMine( hdc, hMemDC, p_board, col, row, FALSE );
 
-    SelectObject( hMemDC, hOldObj ); 
+    SelectObject( hMemDC, hOldObj );
     DeleteDC( hMemDC );
     ReleaseDC( p_board->hWnd, hdc );
 }
@@ -1044,8 +1044,8 @@
 
 void UnpressBoxes( BOARD *p_board, unsigned col, unsigned row )
 {
-    int i, j;    
-    
+    int i, j;
+
     for( i = -1; i <= 1; i++ )
       for( j = -1; j <= 1; j++ ) {
         UnpressBox( p_board, col + i, row + j );
diff --git a/programs/winemine/main.h b/programs/winemine/main.h
index 41741b3..1f8b4cc 100644
--- a/programs/winemine/main.h
+++ b/programs/winemine/main.h
@@ -69,14 +69,14 @@
     RECT mines_rect;
     RECT face_rect;
     RECT timer_rect;
-    RECT counter_rect;    
+    RECT counter_rect;
 
     unsigned width;
     unsigned height;
     POINT pos;
 
     unsigned time;
-    unsigned num_flags;     
+    unsigned num_flags;
     unsigned boxes_left;
     unsigned num_mines;
 
@@ -89,7 +89,7 @@
     DIFFICULTY difficulty;
 
     POINT press;
-    
+
     /* defines for mb */
     #define MB_NONE 0
     #define MB_LEFTDOWN 1
@@ -99,7 +99,7 @@
     #define MB_BOTHDOWN 5
     #define MB_BOTHUP 6
     unsigned mb;
-    
+
     FACE_BMP face_bmp;
     GAME_STATUS status;
     struct BOX_STRUCT
diff --git a/programs/winemine/resource.h b/programs/winemine/resource.h
index 56ea59e..6f1b600 100644
--- a/programs/winemine/resource.h
+++ b/programs/winemine/resource.h
@@ -1,6 +1,6 @@
 /*
  * WineMine (resource.h)
- * 
+ *
  * Copyright 2000 Joshua Thielen <jt85296@ltu.edu>
  *
  * This library is free software; you can redistribute it and/or
diff --git a/programs/winepath/winepath.c b/programs/winepath/winepath.c
index ef54e50..6e44709 100644
--- a/programs/winepath/winepath.c
+++ b/programs/winepath/winepath.c
@@ -26,7 +26,7 @@
 
 #define VERSION "0.1 (" PACKAGE_STRING ")"
 
-enum { 
+enum {
     SHORTFORMAT = 1,
     LONGFORMAT  = 2,
     UNIXFORMAT  = 4
@@ -69,13 +69,13 @@
             return SHORTFORMAT;
         case 'u':
             return UNIXFORMAT;
-    } 
+    }
 
     fprintf(stderr, "%s: invalid option ", progname);
     if (longopt)
         fprintf(stderr, "'%s'\n", longopt);
     else
-        fprintf(stderr, "'-%c'\n", shortopt); 
+        fprintf(stderr, "'-%c'\n", shortopt);
     fprintf(stderr, "Try '%s --help' for help\n", progname);
     exit(2);
 }
@@ -112,7 +112,7 @@
         } else {
             /* short options */
             for (j = 1; argv[i][j]; j++)
-                outputformats |= option(argv[i][j], NULL); 
+                outputformats |= option(argv[i][j], NULL);
         }
 
         /* remove option */
diff --git a/programs/winhelp/hlpfile.c b/programs/winhelp/hlpfile.c
index a52afac..76e0aa0 100644
--- a/programs/winhelp/hlpfile.c
+++ b/programs/winhelp/hlpfile.c
@@ -289,7 +289,7 @@
   UINT      titlesize;
 
   for (pageptr = &hlpfile->first_page; *pageptr; pageptr = &(*pageptr)->next)
-    /* Nothing */; 
+    /* Nothing */;
 
   if (buf + 0x31 > end) {Report("page1"); return(FALSE);};
   title = buf + GET_UINT(buf, 0x10);
@@ -342,7 +342,7 @@
 
   for (page = hlpfile->first_page; page->next; page = page->next) /* Nothing */;
   for (paragraphptr = &page->first_paragraph; *paragraphptr;
-       paragraphptr = &(*paragraphptr)->next) /* Nothing */; 
+       paragraphptr = &(*paragraphptr)->next) /* Nothing */;
 
   if (buf + 0x19 > end) {Report("paragraph2"); return(FALSE);};
 
@@ -580,7 +580,7 @@
   if (_hread(hFile, file_buffer + 16, size - 16) != size - 16)
     {Report("filesize1"); return(FALSE);};
 
-  if (_hread(hFile, dummy, 1) != 0) Report("filesize2"); 
+  if (_hread(hFile, dummy, 1) != 0) Report("filesize2");
 
   file_buffer[size] = '0';
 
diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c
index 622bec2..9912aa9 100644
--- a/programs/winhelp/macro.c
+++ b/programs/winhelp/macro.c
@@ -474,7 +474,7 @@
 VOID MACRO_Print(VOID)
 {
     PRINTDLG printer;
-    
+
     printer.lStructSize         = sizeof(printer);
     printer.hwndOwner           = Globals.active_win->hMainWnd;
     printer.hInstance           = Globals.hInstance;
@@ -494,7 +494,7 @@
     printer.lpSetupTemplateName = 0;
     printer.hPrintTemplate      = 0;
     printer.hSetupTemplate      = 0;
-        
+
     if (PrintDlgA(&printer)) {
         fprintf(stderr, "Print()\n");
     };
diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c
index be5df91..8dc9467 100644
--- a/programs/winhelp/winhelp.c
+++ b/programs/winhelp/winhelp.c
@@ -288,7 +288,7 @@
 
 	  for (button = oldwin->first_button; button; button = button->next)
 	    DestroyWindow(button->hWnd);
-  
+
 	  WINHELP_DeleteWindow(oldwin);
 	  return;
 	}
@@ -384,7 +384,7 @@
 	  /* Menu Info */
 	case 0x113:			MACRO_About();          break;
 
-	case 0x114: 
+	case 0x114:
 	  ShellAbout(hWnd, "WINE", "Help", 0);
 	  break;
 
@@ -541,7 +541,7 @@
 	  new_window_size.cx = old_window_size.cx - old_client_size.cx + new_client_size.cx;
 	  new_window_size.cy = old_window_size.cy - old_client_size.cy + new_client_size.cy;
 
-	  win->hShadowWnd = 
+	  win->hShadowWnd =
 	    CreateWindow(SHADOW_WIN_CLASS_NAME, "", WS_POPUP | WS_VISIBLE,
 			 origin.x + SHADOW_DX, origin.y + SHADOW_DY,
 			 new_window_size.cx, new_window_size.cy,
@@ -847,7 +847,7 @@
       line->rect.left   = space->cx;
       line->rect.right  = space->cx;
 
-      if (**linep) *linep = &(**linep)->next; 
+      if (**linep) *linep = &(**linep)->next;
       **linep = line;
       space->cy = 0;
     }