Index: /trunk/openjdk/jdk/make/sun/awt/Makefile
===================================================================
--- /trunk/openjdk/jdk/make/sun/awt/Makefile	(revision 192)
+++ /trunk/openjdk/jdk/make/sun/awt/Makefile	(revision 193)
@@ -321,10 +321,9 @@
                -lgdi32.lib -lshell32.lib -lcomdlg32.lib \
                -lversion.lib -lmpr.lib -lrasapi32.lib \
-               -lwinmm.lib -lwinspool.lib -lvfw32.lib \
+               -lwinmm.lib -lwinspool.lib \
                -lsecur32.lib -loleacc.lib -loledlg.lib \
-               -lsensapi.lib \
                -lkernel32.lib -luser32.lib -lgdi32.lib -lwinspool.lib \
-               -limm32.lib -lole32.lib -luuid.lib $(JVMLIB) \
-               -lshell32.lib
+               -limm32os2.lib -lole32.lib -lguidlib.lib $(JVMLIB) \
+               -lddraw.lib -lshell32.lib
 
 clean:: awt.clean
Index: /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawObject.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawObject.cpp	(revision 192)
+++ /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawObject.cpp	(revision 193)
@@ -263,5 +263,9 @@
     lpPrimary = NULL;
     d3dContext = NULL;
+#ifdef __WIN32OS2__
+    deviceUseD3D = FALSE;
+#else
     deviceUseD3D = useD3D;
+#endif
     this->dxObject = dxObject;
 }
@@ -548,4 +552,5 @@
 DDraw::InitD3DContext()
 {
+#ifndef __WIN32OS2__
     J2dTraceLn(J2D_TRACE_INFO, "DDraw::InitD3DContext");
     // note: the first time the context initialization fails,
@@ -562,4 +567,5 @@
         }
     }
+#endif
 }
 
@@ -567,8 +573,10 @@
 DDraw::ReleaseD3DContext()
 {
+#ifndef __WIN32OS2__
     J2dTraceLn(J2D_TRACE_INFO, "DDraw::ReleaseD3DContext");
     if (d3dContext != NULL) {
         d3dContext->Release3DDevice();
     }
+#endif
 }
 
@@ -1054,8 +1062,10 @@
 
 void DDrawSurface::FlushD3DContext(BOOL bForce) {
+#ifndef __WIN32OS2__
     D3DContext *d3dContext = ddObject->GetD3dContext();
     if (d3dContext) {
         d3dContext->FlushD3DQueueForTarget(bForce ? NULL : this);
     }
+#endif
 }
 
Index: /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawUtils.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawUtils.cpp	(revision 192)
+++ /trunk/openjdk/jdk/src/windows/native/sun/java2d/windows/ddrawUtils.cpp	(revision 193)
@@ -24,5 +24,7 @@
  */
 
+#ifndef __WIN32OS2__
 #define INITGUID
+#endif
 #include "Trace.h"
 #include "ddrawUtils.h"
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/ShellFolder2.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/ShellFolder2.cpp	(revision 192)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/ShellFolder2.cpp	(revision 193)
@@ -181,5 +181,5 @@
                                          (CHAR*)pidl + pStrret->uOffset);
         case STRRET_WSTR :
-            return env->NewString(pStrret->pOleStr,
+            return env->NewString(reinterpret_cast<const jchar*>(pStrret->pOleStr),
                 static_cast<jsize>(wcslen(pStrret->pOleStr)));
     }
@@ -187,5 +187,7 @@
 }
 // restoring the original definition
-#define JNU_NewStringPlatform(env, x) env->NewString(x, static_cast<jsize>(_tcslen(x)))
+#define JNU_NewStringPlatform(env, x) \
+    env->NewString(reinterpret_cast<const jchar*>(x), \
+        static_cast<jsize>(_tcslen(reinterpret_cast<const WCHAR*>(x))))
 
 /*
@@ -727,8 +729,8 @@
     jchar* wszPath = new jchar[nLength + 1];
     const jchar* strPath = env->GetStringChars(jname, NULL);
-    wcsncpy(wszPath, strPath, nLength);
+    wcsncpy(reinterpret_cast<wchar_t*>(wszPath), reinterpret_cast<const wchar_t*>(strPath), nLength);
     wszPath[nLength] = 0;
     HRESULT res = pIShellFolder->ParseDisplayName(NULL, NULL,
-                        const_cast<jchar*>(wszPath), NULL, &pIDL, NULL);
+                        reinterpret_cast<WCHAR*>(wszPath), NULL, &pIDL, NULL);
     if (res != S_OK) {
         JNU_ThrowIOException(env, "Could not parse name");
@@ -863,4 +865,7 @@
     HICON hIcon = NULL;
 
+#ifdef __WIN32OS2__
+    // @todo Odin32 doesn't define IExtractIcon, use native API instead
+#else
     HRESULT hres;
     if (IS_NT) {
@@ -911,4 +916,5 @@
         }
     }
+#endif /* __WIN32OS2__ */
     return (jlong)hIcon;
 }
@@ -1012,5 +1018,5 @@
     if (libShell32 != NULL) {
         hBitmap = (HBITMAP)LoadImage(libShell32,
-                    isVista ? TEXT("IDB_TB_SH_DEF_16") : MAKEINTRESOURCE(216),
+                    isVista ? TEXT("IDB_TB_SH_DEF_16") : (LPCTSTR)MAKEINTRESOURCE(216),
                     IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
     }
@@ -1018,5 +1024,5 @@
         libComCtl32 = LoadLibrary(TEXT("comctl32.dll"));
         if (libComCtl32 != NULL) {
-            hBitmap = (HBITMAP)LoadImage(libComCtl32, MAKEINTRESOURCE(124),
+            hBitmap = (HBITMAP)LoadImage(libComCtl32, (LPCTSTR)MAKEINTRESOURCE(124),
                                          IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
         }
@@ -1082,5 +1088,5 @@
     (JNIEnv* env, jclass cls, jint iconID)
 {
-    return (jlong)LoadIcon(NULL, MAKEINTRESOURCE(iconID));
+    return (jlong)LoadIcon(NULL, (LPCTSTR)MAKEINTRESOURCE(iconID));
 }
 
@@ -1095,8 +1101,8 @@
      jint cxDesired, jint cyDesired, jboolean useVGAColors)
 {
-    HINSTANCE libHandle = LoadLibrary(env->GetStringChars(libName, NULL));
+    HINSTANCE libHandle = LoadLibrary(reinterpret_cast<const WCHAR*>(env->GetStringChars(libName, NULL)));
     if (libHandle != NULL) {
         UINT fuLoad = (useVGAColors && !isXP) ? LR_VGACOLOR : 0;
-        return ptr_to_jlong(LoadImage(libHandle, MAKEINTRESOURCE(iconID),
+        return ptr_to_jlong(LoadImage(libHandle, (LPCTSTR)MAKEINTRESOURCE(iconID),
                                       IMAGE_ICON, cxDesired, cyDesired,
                                       fuLoad));
@@ -1195,4 +1201,5 @@
     }
 
+#ifndef __WIN32OS2__
     hr = pIShellFolder->CreateViewObject(NULL, IID_IShellDetails, (void**)&pIUnknown);
     if(SUCCEEDED (hr)) {
@@ -1231,4 +1238,5 @@
         return columns;
     }
+#endif /* !__WIN32OS2__ */
 
     // The folder exposes neither IShellFolder2 nor IShelDetails
@@ -1268,4 +1276,6 @@
     }
 
+#ifndef __WIN32OS2__
+    // @todo Odin32 doesn't define IExtractIcon, use native API instead
     hr = pIShellFolder->CreateViewObject(NULL, IID_IShellDetails, (void**)&pIUnknown);
     if(SUCCEEDED (hr)) {
@@ -1279,4 +1289,5 @@
         }
     }
+#endif /* !__WIN32OS2__ */
 
     // The folder exposes neither IShellFolder2 nor IShelDetails
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.cpp	(revision 192)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/UnicowsLoader.cpp	(revision 193)
@@ -27,4 +27,9 @@
 #include "alloc.h"
 #include "UnicowsLoader.h"
+
+#ifdef __WIN32OS2__
+#include <minivcrt.h>
+#define _CW_DEFAULT CW_DEFAULT
+#endif
 
 /*
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp	(revision 192)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp	(revision 193)
@@ -734,7 +734,7 @@
     }
 
-    tooltipStr = env->GetStringChars(jtooltip, (jboolean *)NULL);
+    tooltipStr = reinterpret_cast<LPCTSTR>(env->GetStringChars(jtooltip, (jboolean *)NULL));
     trayIcon->SetToolTip(tooltipStr);
-    env->ReleaseStringChars(jtooltip, tooltipStr);
+    env->ReleaseStringChars(jtooltip, reinterpret_cast<const jchar *>(tooltipStr));
 ret:
     env->DeleteGlobalRef(self);
@@ -777,8 +777,9 @@
 
     PDATA pData;
+    BOOL result;
     JNI_CHECK_PEER_GOTO(self, ret);
     trayIcon = (AwtTrayIcon *)pData;
 
-    BOOL result = trayIcon->SendTrayMessage(jupdate == JNI_TRUE ? NIM_MODIFY : NIM_ADD);
+    result = trayIcon->SendTrayMessage(jupdate == JNI_TRUE ? NIM_MODIFY : NIM_ADD);
     // 6270114: Instructs the taskbar to behave according to the Shell version 5.0
     if (result && jupdate == JNI_FALSE) {
@@ -856,13 +857,13 @@
     trayIcon = (AwtTrayIcon *)pData;
 
-    captionStr = env->GetStringChars(jcaption, (jboolean *)NULL);
-    textStr = env->GetStringChars(jtext, (jboolean *)NULL);
-    msgTypeStr = env->GetStringChars(jmsgType, (jboolean *)NULL);
+    captionStr = reinterpret_cast<LPCTSTR>(env->GetStringChars(jcaption, (jboolean *)NULL));
+    textStr = reinterpret_cast<LPCTSTR>(env->GetStringChars(jtext, (jboolean *)NULL));
+    msgTypeStr = reinterpret_cast<LPCTSTR>(env->GetStringChars(jmsgType, (jboolean *)NULL));
 
     trayIcon->DisplayMessage(captionStr, textStr, msgTypeStr);
 
-    env->ReleaseStringChars(jcaption, captionStr);
-    env->ReleaseStringChars(jtext, textStr);
-    env->ReleaseStringChars(jmsgType, msgTypeStr);
+    env->ReleaseStringChars(jcaption, reinterpret_cast<const jchar *>(captionStr));
+    env->ReleaseStringChars(jtext, reinterpret_cast<const jchar *>(textStr));
+    env->ReleaseStringChars(jmsgType, reinterpret_cast<const jchar *>(msgTypeStr));
 ret:
     env->DeleteGlobalRef(self);
Index: /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_dlls.cpp
===================================================================
--- /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_dlls.cpp	(revision 192)
+++ /trunk/openjdk/jdk/src/windows/native/sun/windows/awt_dlls.cpp	(revision 193)
@@ -26,4 +26,8 @@
 #include "awt.h"
 #include "awt_dlls.h"
+
+#ifdef __WIN32OS2__
+#include <minivcrt.h>
+#endif
 
 /*
@@ -293,5 +297,5 @@
         DWORD     dwVerHnd = 0;
         DWORD     dwVersionInfoSize;
-        LPVOID    lpVersionInfo;
+        LPBYTE    lpVersionInfo;
         UINT      uLength = 0;
         struct LANGANDCODEPAGE {
