Index: trunk/src/pe2lx/icon.cpp
===================================================================
--- trunk/src/pe2lx/icon.cpp	(revision 346)
+++ trunk/src/pe2lx/icon.cpp	(revision 349)
@@ -1,3 +1,3 @@
-/* $Id: icon.cpp,v 1.3 1999-06-10 17:08:53 phaller Exp $ */
+/* $Id: icon.cpp,v 1.4 1999-07-20 17:50:19 sandervl Exp $ */
 
 /*
@@ -35,5 +35,5 @@
 {
  RGBQUAD *rgb;
- RGB     *os2rgb;
+ RGB2    *os2rgb;
  int bwsize, i, colorsize, rgbsize;
  OS2Icon *icon = OS2Icon::icons;
@@ -91,5 +91,5 @@
   //for color bitmap + RGB structs for all the colors
   //SvL, 3-3-98: 2*bwsize
-  iconsize = 2*sizeof(BITMAPFILEHEADER) + 2*sizeof(RGB) +
+  iconsize = 2*sizeof(BITMAPFILEHEADER2) + 2*sizeof(RGB2) +
              rgbsize + 2*bwsize + bmpHdr->biSizeImage;
   //There are icons without an XOR mask, so check for it
@@ -97,32 +97,37 @@
         iconsize += bwsize;
   }
-  iconhdr  = (BITMAPFILEHEADER *)malloc(iconsize);
+  iconhdr  = (BITMAPFILEHEADER2 *)malloc(iconsize);
+  memset(iconhdr, 0, iconsize);
   iconhdr->usType        = BFT_COLORICON;
-  iconhdr->cbSize        = sizeof(BITMAPFILEHEADER);
+  iconhdr->cbSize        = sizeof(BITMAPFILEHEADER2);
   iconhdr->xHotspot      = 0;
   iconhdr->yHotspot      = 0;
-  iconhdr->offBits       = 2*sizeof(BITMAPFILEHEADER) +
-                           2*sizeof(RGB) + rgbsize;
-  iconhdr->bmp.cbFix     = sizeof(BITMAPINFOHEADER);
-  iconhdr->bmp.cx        = (USHORT)bmpHdr->biWidth;
-  iconhdr->bmp.cy        = (USHORT)bmpHdr->biHeight;
-  iconhdr->bmp.cPlanes   = 1;
-  iconhdr->bmp.cBitCount = 1;
-  os2rgb                 = (RGB *)(iconhdr+1);
-  memset(os2rgb, 0, sizeof(RGB));
-  memset(os2rgb+1, 0xff, sizeof(RGB));
-  iconhdr2               = (BITMAPFILEHEADER *)(os2rgb+2);
+  iconhdr->offBits       = 2*sizeof(BITMAPFILEHEADER2) +
+                           2*sizeof(RGB2) + rgbsize;
+  iconhdr->bmp2.cbFix    = sizeof(BITMAPINFOHEADER2);
+  iconhdr->bmp2.cx       = (USHORT)bmpHdr->biWidth;
+  iconhdr->bmp2.cy       = (USHORT)bmpHdr->biHeight;
+  iconhdr->bmp2.cPlanes  = 1;
+  iconhdr->bmp2.cBitCount= 1;
+  iconhdr->bmp2.ulCompression   = BCA_UNCOMP;
+  iconhdr->bmp2.ulColorEncoding = BCE_RGB;
+  os2rgb                 = (RGB2 *)(iconhdr+1);
+  memset(os2rgb, 0, sizeof(RGB2));
+  memset(os2rgb+1, 0xff, sizeof(RGB)); //not reserved byte
+  iconhdr2               = (BITMAPFILEHEADER2 *)(os2rgb+2);
   iconhdr2->usType       = BFT_COLORICON;
-  iconhdr2->cbSize       = sizeof(BITMAPFILEHEADER);
+  iconhdr2->cbSize       = sizeof(BITMAPFILEHEADER2);
   iconhdr2->xHotspot     = 0;
   iconhdr2->yHotspot     = 0;
-  iconhdr2->offBits      = 2*sizeof(BITMAPFILEHEADER) +
-                           2*sizeof(RGB) + rgbsize + 2*bwsize;
-  iconhdr2->bmp.cbFix    = sizeof(BITMAPINFOHEADER);
-  iconhdr2->bmp.cx       = (USHORT)bmpHdr->biWidth;
-  iconhdr2->bmp.cy       = (USHORT)(bmpHdr->biHeight/2);
-  iconhdr2->bmp.cPlanes  = bmpHdr->biPlanes;
-  iconhdr2->bmp.cBitCount= bmpHdr->biBitCount;
-  os2rgb                 = (RGB *)(iconhdr2+1);
+  iconhdr2->offBits      = 2*sizeof(BITMAPFILEHEADER2) +
+                           2*sizeof(RGB2) + rgbsize + 2*bwsize;
+  iconhdr2->bmp2.cbFix   = sizeof(BITMAPINFOHEADER2);
+  iconhdr2->bmp2.cx      = (USHORT)bmpHdr->biWidth;
+  iconhdr2->bmp2.cy      = (USHORT)(bmpHdr->biHeight/2);
+  iconhdr2->bmp2.cPlanes = bmpHdr->biPlanes;
+  iconhdr2->bmp2.cBitCount= bmpHdr->biBitCount;
+  iconhdr2->bmp2.ulCompression   = BCA_UNCOMP;
+  iconhdr2->bmp2.ulColorEncoding = BCE_RGB;
+  os2rgb                 = (RGB2 *)(iconhdr2+1);
   rgb                    = (RGBQUAD *)(bmpHdr+1);
   if(bmpHdr->biBitCount < 24) {
@@ -173,5 +178,5 @@
 //******************************************************************************
 //******************************************************************************
-BITMAPFILEHEADER *OS2Icon::GetIconHeader()
+BITMAPFILEHEADER2 *OS2Icon::GetIconHeader()
 {
   return(iconhdr);
Index: trunk/src/pe2lx/icon.h
===================================================================
--- trunk/src/pe2lx/icon.h	(revision 346)
+++ trunk/src/pe2lx/icon.h	(revision 349)
@@ -1,5 +1,5 @@
-/* $Id: icon.h,v 1.3 1999-06-10 17:08:53 phaller Exp $ */
-
-/* $Header: /home/ktk/tmp/odin/2007/netlabs.cvs/odin32/src/pe2lx/icon.h,v 1.3 1999-06-10 17:08:53 phaller Exp $
+/* $Id: icon.h,v 1.4 1999-07-20 17:50:19 sandervl Exp $ */
+
+/* $Header: /home/ktk/tmp/odin/2007/netlabs.cvs/odin32/src/pe2lx/icon.h,v 1.4 1999-07-20 17:50:19 sandervl Exp $
  *
  * Declarations, protypes and defintions for conversion of icons.
@@ -198,5 +198,5 @@
         int                QueryIconSize();
         void               SetIconHdrOffset(int offset);
-        BITMAPFILEHEADER  *GetIconHeader();
+        BITMAPFILEHEADER2 *GetIconHeader();
 
         static OS2Icon    *GetIcon(int id);
@@ -207,6 +207,6 @@
 private:
         int                       id, iconsize, prevoffset;
-        BITMAPFILEHEADER         *iconhdr;
-        BITMAPFILEHEADER         *iconhdr2;
+        BITMAPFILEHEADER2        *iconhdr;
+        BITMAPFILEHEADER2        *iconhdr2;
 
         //@KSO: This may need to be changed later. Statics work fine for one single file,
Index: trunk/src/pe2lx/icongrp.cpp
===================================================================
--- trunk/src/pe2lx/icongrp.cpp	(revision 346)
+++ trunk/src/pe2lx/icongrp.cpp	(revision 349)
@@ -1,3 +1,3 @@
-/* $Id: icongrp.cpp,v 1.3 1999-06-10 17:08:54 phaller Exp $ */
+/* $Id: icongrp.cpp,v 1.4 1999-07-20 17:50:19 sandervl Exp $ */
 
 /*
@@ -41,5 +41,5 @@
  ResourceDirectory *rdir = (ResourceDirectory *)(ihdr + 1);
  int i, groupsize = 0;
- BITMAPARRAYFILEHEADER *bafh, *orgbafh;
+ BITMAPARRAYFILEHEADER2 *bafh, *orgbafh;
  OS2Icon *icon;
 
@@ -59,5 +59,5 @@
         rdir++;
   }
-  bafh    = (BITMAPARRAYFILEHEADER *)malloc(groupsize+ihdr->wCount*sizeof(BITMAPARRAYFILEHEADER));
+  bafh    = (BITMAPARRAYFILEHEADER2 *)malloc(groupsize+ihdr->wCount*sizeof(BITMAPARRAYFILEHEADER2));
   orgbafh = bafh;
 
@@ -65,5 +65,5 @@
   for(i=0;i<ihdr->wCount;i++) {
         bafh->usType    = BFT_BITMAPARRAY;
-        bafh->cbSize    = sizeof(BITMAPARRAYFILEHEADER);
+        bafh->cbSize    = sizeof(BITMAPARRAYFILEHEADER2);
         bafh->cxDisplay = 0;
         bafh->cyDisplay = 0;
@@ -75,15 +75,15 @@
         }
         if(i != ihdr->wCount -1) {
-                bafh->offNext = (int)&bafh->bfh - (int)orgbafh + icon->QueryIconSize();
+                bafh->offNext = (int)&bafh->bfh2 - (int)orgbafh + icon->QueryIconSize();
         }
         else    bafh->offNext = 0;
 
-        icon->SetIconHdrOffset((int)bafh - (int)orgbafh + sizeof(BITMAPARRAYFILEHEADER)-sizeof(BITMAPFILEHEADER));
+        icon->SetIconHdrOffset((int)bafh - (int)orgbafh + sizeof(BITMAPARRAYFILEHEADER2)-sizeof(BITMAPFILEHEADER2));
 
-        memcpy((char *)&bafh->bfh, (char *)icon->GetIconHeader(), icon->QueryIconSize());
-        bafh = (BITMAPARRAYFILEHEADER *)((int)&bafh->bfh + icon->QueryIconSize());
+        memcpy((char *)&bafh->bfh2, (char *)icon->GetIconHeader(), icon->QueryIconSize());
+        bafh = (BITMAPARRAYFILEHEADER2 *)((int)&bafh->bfh2 + icon->QueryIconSize());
         rdir++;
   }
-  OS2Exe.StoreResource(id, RT_POINTER, groupsize+ihdr->wCount*sizeof(BITMAPARRAYFILEHEADER), (char *)orgbafh);
+  OS2Exe.StoreResource(id, RT_POINTER, groupsize+ihdr->wCount*sizeof(BITMAPARRAYFILEHEADER2), (char *)orgbafh);
   free((char *)orgbafh);
 }
