bug 45267
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.c
index 9ca13a3..99de5ce 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.c
@@ -2008,11 +2008,21 @@
 {
 	COMBOBOXINFO _arg1, *lparg1=NULL;
 	jboolean rc;
-	
 	DEBUG_CALL("GetComboBoxInfo\n\n")
-
 	if (arg1) lparg1 = getCOMBOBOXINFOFields(env, arg1, &_arg1);
-	rc = (jboolean)GetComboBoxInfo((HWND)arg0, lparg1);
+	{
+		/*
+		*  GetComboBoxInfo is a Win2000 and Win98 specific call
+		*  If you link it into swt.dll a system modal entry point not found dialog will
+		*  appear as soon as swt.dll is loaded. Here we check for the entry point and
+		*  only do the call if it exists.
+		*/
+		HMODULE hm;
+		FARPROC fp;
+    	if ((hm=GetModuleHandle("user32.dll")) && (fp=GetProcAddress(hm, "GetComboBoxInfo"))) {
+			rc = (jboolean)(fp)((HWND)arg0, lparg1);
+    	}
+	}
 	if (arg1) setCOMBOBOXINFOFields(env, arg1, lparg1);
 	return rc;
 }
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
index 89b8f36..7a7991f 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
@@ -1983,7 +1983,7 @@
 	}
 	int layout = data.layout;
 	if (layout != -1) {
-		if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10))  {
+		if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
 			int flags = OS.GetLayout(hDC);
 			if ((flags & OS.LAYOUT_RTL) != (layout & OS.LAYOUT_RTL)) {
 				flags &= ~OS.LAYOUT_RTL;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java
index 27cd786..6f587a0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java
@@ -134,10 +134,12 @@
 public static void drawGlyphs(GC gc, char[] renderBuffer, int[] renderDx, int x, int y) {
 	int length = renderDx.length;
 	
-	if (OS.GetLayout (gc.handle) != 0) {
-		reverse(renderDx);
-		renderDx[length-1]--;               //fixes bug 40006
-		reverse(renderBuffer);
+	if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+		if (OS.GetLayout (gc.handle) != 0) {
+			reverse(renderDx);
+			renderDx[length-1]--;               //fixes bug 40006
+			reverse(renderBuffer);
+		}
 	}	
 	// render transparently to avoid overlapping segments. fixes bug 40006
 	int oldBkMode = OS.SetBkMode(gc.handle, OS.TRANSPARENT);
@@ -167,7 +169,10 @@
 	int hHeap = OS.GetProcessHeap();
 	int[] lpCs = new int[8];
 	int cs = OS.GetTextCharset(gc.handle);
-	boolean isRightOriented = OS.GetLayout(gc.handle) != 0; 
+	boolean isRightOriented = false;
+	if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+		isRightOriented = OS.GetLayout(gc.handle) != 0;
+	}
 	OS.TranslateCharsetInfo(cs, lpCs, OS.TCI_SRCCHARSET);
 	TCHAR textBuffer = new TCHAR(lpCs[1], text, false);
 	int byteCount = textBuffer.length();
@@ -300,7 +305,10 @@
 	OS.TranslateCharsetInfo(cs, lpCs, OS.TCI_SRCCHARSET);
 	TCHAR textBuffer = new TCHAR(lpCs[1], text, false);
 	int byteCount = textBuffer.length();
-	boolean isRightOriented = (OS.GetLayout(gc.handle) != 0); 
+	boolean isRightOriented = false;
+	if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+		isRightOriented = OS.GetLayout(gc.handle) != 0;
+	}
 
 	GCP_RESULTS result = new GCP_RESULTS();
 	result.lStructSize = GCP_RESULTS.sizeof;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index dc0b14f..b7fa98f 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -1016,16 +1016,20 @@
 	}
 	if (hDC == 0) SWT.error(SWT.ERROR_NO_HANDLES);
 	if (data != null) {
-		int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
-		if ((data.style & mask) != 0) {
-			data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0;
-		} else {
-			int flags = OS.GetLayout (hDC);
-			if ((flags & OS.LAYOUT_RTL) != 0) {
-				data.style |= SWT.RIGHT_TO_LEFT | SWT.MIRRORED;
+		if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+			int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+			if ((data.style & mask) != 0) {
+				data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0;
 			} else {
-				data.style |= SWT.LEFT_TO_RIGHT;
+				int flags = OS.GetLayout (hDC);
+				if ((flags & OS.LAYOUT_RTL) != 0) {
+					data.style |= SWT.RIGHT_TO_LEFT | SWT.MIRRORED;
+				} else {
+					data.style |= SWT.LEFT_TO_RIGHT;
+				}
 			}
+		} else {
+			data.style |= SWT.LEFT_TO_RIGHT;
 		}
 		data.device = getDisplay ();
 		data.foreground = getForegroundPixel ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index dc56325..2899b20 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -1601,7 +1601,9 @@
 	int count = 4;
 	int hStateList = OS.ImageList_Create (width, height, OS.ILC_COLOR, count, count);
 	int hDC = OS.GetDC (handle);
-	OS.SetLayout (hDC, 0);
+	if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+		OS.SetLayout (hDC, 0);
+	}
 	int memDC = OS.CreateCompatibleDC (hDC);
 	int hBitmap = OS.CreateCompatibleBitmap (hDC, width * count, height);
 	int hOldBitmap = OS.SelectObject (memDC, hBitmap);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
index 3ec3ac8..d68df5c 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
@@ -921,7 +921,9 @@
 	int height = OS.SendMessage (handle, OS.TVM_GETITEMHEIGHT, 0, 0), width = height;
 	int hImageList = OS.ImageList_Create (width, height, OS.ILC_COLOR, count, count);
 	int hDC = OS.GetDC (handle);
-	OS.SetLayout (hDC, 0);
+	if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+		OS.SetLayout (hDC, 0);
+	}
 	int memDC = OS.CreateCompatibleDC (hDC);
 	int hBitmap = OS.CreateCompatibleBitmap (hDC, width * count, height);
 	int hOldBitmap = OS.SelectObject (memDC, hBitmap);