Index: trunk/src/kernel32/unicode.cpp
===================================================================
--- trunk/src/kernel32/unicode.cpp	(revision 162)
+++ trunk/src/kernel32/unicode.cpp	(revision 163)
@@ -1,3 +1,3 @@
-/* $Id: unicode.cpp,v 1.7 1999-06-10 20:47:54 phaller Exp $ */
+/* $Id: unicode.cpp,v 1.8 1999-06-23 19:36:24 phaller Exp $ */
 
 /*
@@ -230,19 +230,3 @@
   AsciiToUnicodeN(ascii, unicode, strlen(ascii));
 }
-//******************************************************************************
-//TODO: use OS/2 unicode stuff
-//******************************************************************************
-char *UnicodeToAscii(int length, WCHAR *NameString)
-{
-static char asciistring[256];
-int i;
-
-  if(length >= 255) length = 255;
-  for(i=0;i<length;i++) {
-    asciistring[i] = NameString[i] & 0xFF;
-  }
-  asciistring[length] = 0;
-  return(asciistring);
-}
-//******************************************************************************
-//******************************************************************************
+
Index: trunk/src/kernel32/winimgres.cpp
===================================================================
--- trunk/src/kernel32/winimgres.cpp	(revision 162)
+++ trunk/src/kernel32/winimgres.cpp	(revision 163)
@@ -1,3 +1,3 @@
-/* $Id: winimgres.cpp,v 1.3 1999-06-10 19:09:04 phaller Exp $ */
+/* $Id: winimgres.cpp,v 1.4 1999-06-23 19:36:24 phaller Exp $ */
 
 /*
@@ -30,4 +30,23 @@
        "GROUP_CURSOR", "niks", "GROUP_ICON", "niks", "VERSION"};
 
+
+//******************************************************************************
+//TODO: use OS/2 unicode stuff
+//******************************************************************************
+char *extremelyuglyUnicodeToAscii(int length, WCHAR *NameString)
+{
+static char asciistring[256];
+int i;
+
+  if(length >= 255) length = 255;
+  for(i=0;i<length;i++) {
+    asciistring[i] = NameString[i] & 0xFF;
+  }
+  asciistring[length] = 0;
+  return(asciistring);
+}
+//******************************************************************************
+//******************************************************************************
+
 //******************************************************************************
 //Assuming names are case insensitive
@@ -94,5 +113,5 @@
         //SvL: 30-10-'97, high bit is set, so clear to get real offset
         prde->u1.Name &= ~0x80000000;
-        char *resname = UnicodeToAscii(*(WCHAR *)((ULONG)pResDir + (ULONG)prde->u1.Name), (WCHAR *)((ULONG)pResDir + (ULONG)prde->u1.Name + sizeof(WCHAR)));  // first word = string length
+        char *resname = extremelyuglyUnicodeToAscii(*(WCHAR *)((ULONG)pResDir + (ULONG)prde->u1.Name), (WCHAR *)((ULONG)pResDir + (ULONG)prde->u1.Name + sizeof(WCHAR)));  // first word = string length
         if(!fNumId) {
             if(stricmp(resname, (char *)type) == 0) {
@@ -186,31 +205,31 @@
     if(!fNumId) {//name or id entry?
         if(prde->u1.s.NameIsString) //unicode directory string /*PLF Sat  97-06-21 22:30:35*/
-            	prde->u1.Name &= ~0x80000000;
-	        pstring = (PIMAGE_RESOURCE_DIR_STRING_U)((ULONG)pResDir + (ULONG)prde->u1.Name);
-        	resname = UnicodeToAscii(pstring->Length, pstring->NameString);
-        	if(stricmp(resname, (char *)*nodeData) == 0) {
-            		fFound = TRUE;
-        	}
-    	}
-    	else {
-        	if(*nodeData == prde->u1.Id)
-	            	fFound = TRUE;
-    	}
-    	if(*nodeData == LANG_GETFIRST)
-        	fFound = TRUE;
-
-	if(fFound) {
-        	if((ULONG)prdType2 & 0x80000000) {//subdirectory?
-	            ProcessResSubDir(prdType2, nodeData+1);
-	        }
-	        else {
-        	    pData = (PIMAGE_RESOURCE_DATA_ENTRY)prdType2;
-	            if(pData->Size) {//winamp17 winzip archive has resource with size 0
-        	        return(pData);
-	            }
-        	    else    return(NULL);
-        	}
-    	}
-    	prde++;
+               prde->u1.Name &= ~0x80000000;
+           pstring = (PIMAGE_RESOURCE_DIR_STRING_U)((ULONG)pResDir + (ULONG)prde->u1.Name);
+         resname = extremelyuglyUnicodeToAscii(pstring->Length, pstring->NameString);
+         if(stricmp(resname, (char *)*nodeData) == 0) {
+                  fFound = TRUE;
+         }
+      }
+      else {
+         if(*nodeData == prde->u1.Id)
+                  fFound = TRUE;
+      }
+      if(*nodeData == LANG_GETFIRST)
+         fFound = TRUE;
+
+   if(fFound) {
+         if((ULONG)prdType2 & 0x80000000) {//subdirectory?
+               ProcessResSubDir(prdType2, nodeData+1);
+           }
+           else {
+             pData = (PIMAGE_RESOURCE_DATA_ENTRY)prdType2;
+               if(pData->Size) {//winamp17 winzip archive has resource with size 0
+                 return(pData);
+               }
+             else    return(NULL);
+         }
+      }
+      prde++;
   }
   return(NULL);
@@ -237,5 +256,5 @@
         if(i == MAX_RES) {//custom resource type, stored as rcdata
                 dprintf(("FindResourceA custom type %s\n", lpszType));
-            	lpszType = (LPSTR)NTRT_RCDATA;
+               lpszType = (LPSTR)NTRT_RCDATA;
         }
         else    lpszType = (LPSTR)i;
@@ -271,8 +290,8 @@
     if((int)lpszName >> 16 != 0) {//convert string name identifier to numeric id
         dprintf(("FindResource %s\n", lpszName));
-     	if(lpszName[0] == '#') {// #344
-          	lpszName = (LPCSTR)atoi(&lpszName[1]);
-     	}
-     	else 	lpszName = (LPCSTR)ConvertNameId(hinstance, (char *)lpszName);
+      if(lpszName[0] == '#') {// #344
+            lpszName = (LPCSTR)atoi(&lpszName[1]);
+      }
+      else  lpszName = (LPCSTR)ConvertNameId(hinstance, (char *)lpszName);
     }
     else dprintf(("FindResource %d\n", (int)lpszName));
@@ -280,13 +299,13 @@
     hres = O32_FindResource(hinstance, lpszName, szType);
     if(hres) {
-    	res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
+      res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
     }
 
     if(hres == NULL && (int)lpszName >> 16 == 0 && (int)szType == NTRT_STRING) {
-    	hres = O32_FindResource(hinstance, (LPCSTR)(((int)lpszName - 1)*16), (LPCSTR)NTRT_RCDATA);
-    	if(hres) {
-        	res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
-    	}
-    	else    dprintf(("FindResourceA can't find string %d\n", (int)lpszName));
+      hres = O32_FindResource(hinstance, (LPCSTR)(((int)lpszName - 1)*16), (LPCSTR)NTRT_RCDATA);
+      if(hres) {
+         res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
+      }
+      else    dprintf(("FindResourceA can't find string %d\n", (int)lpszName));
     }
     dprintf(("FindResourceA returned %X (%X)\n", hres, GetLastError()));
@@ -364,10 +383,10 @@
 
     if((int)lpszName >> 16 != 0) {//convert string name identifier to numeric id
-     	astring1 = UnicodeToAsciiString(lpszName);
+      astring1 = UnicodeToAsciiString(lpszName);
         dprintf(("FindResourceW %X %s\n", hinstance, astring1));
-     	if(astring1[0] == '#') {// #344
-          	lpszName = (LPWSTR)atoi(&astring1[1]);
-     	}
-     	else 	lpszName = (LPWSTR)ConvertNameId(hinstance, (char *)astring1);
+      if(astring1[0] == '#') {// #344
+            lpszName = (LPWSTR)atoi(&astring1[1]);
+      }
+      else  lpszName = (LPWSTR)ConvertNameId(hinstance, (char *)astring1);
     }
     else dprintf(("FindResourceW %X %d\n", hinstance, (int)lpszName));
@@ -375,13 +394,13 @@
     hres = O32_FindResource(hinstance, (LPCSTR)lpszName, (LPCSTR)szType);
     if(hres) {
-    	res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
+      res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
     }
 
     if(hres == NULL && (int)lpszName >> 16 == 0 && (int)szType == NTRT_STRING) {
-    	hres = O32_FindResource(hinstance, (LPCSTR)(((ULONG)lpszName - 1)*16), (LPCSTR)NTRT_RCDATA);
-    	if(hres) {
-        	res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
-    	}
-    	else    dprintf(("FindResourceW can't find string %d\n", (int)lpszName));
+      hres = O32_FindResource(hinstance, (LPCSTR)(((ULONG)lpszName - 1)*16), (LPCSTR)NTRT_RCDATA);
+      if(hres) {
+         res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
+      }
+      else    dprintf(("FindResourceW can't find string %d\n", (int)lpszName));
     }
     if(astring1)    FreeAsciiString(astring1);
