Author: jimtabor
Date: Sun Nov 4 03:55:28 2007
New Revision: 30098
URL:
http://svn.reactos.org/svn/reactos?rev=30098&view=rev
Log:
- Removed NtGdiTranslateCharsetInfo, updated w32ksvc.db and ntgdibad.h.
- Implemented TranslateCharsetInfo from wine. Works the same just different.
Modified:
trunk/reactos/dll/win32/gdi32/misc/stubs.c
trunk/reactos/dll/win32/gdi32/objects/font.c
trunk/reactos/include/reactos/win32k/ntgdibad.h
trunk/reactos/subsystems/win32/win32k/objects/text.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Sun Nov 4 03:55:28 2007
@@ -20,19 +20,6 @@
#define UNIMPLEMENTED DbgPrint("GDI32: %s is unimplemented, please try again
later.\n", __FUNCTION__);
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-TranslateCharsetInfo(DWORD * lpSrc,
- LPCHARSETINFO lpCs,
- DWORD dwFlags)
-{
- /* FIXME share memory */
- return NtGdiTranslateCharsetInfo(lpSrc, lpCs, dwFlags );
-}
/*
* @unimplemented
Modified: trunk/reactos/dll/win32/gdi32/objects/font.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/fo…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/font.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/font.c Sun Nov 4 03:55:28 2007
@@ -12,6 +12,51 @@
#define NDEBUG
#include <debug.h>
+
+/*
+ * For TranslateCharsetInfo
+ */
+#define FS(x) {{0,0,0,0},{0x1<<(x),0}}
+#define MAXTCIINDEX 32
+static const CHARSETINFO FONT_tci[MAXTCIINDEX] = {
+ /* ANSI */
+ { ANSI_CHARSET, 1252, FS(0)},
+ { EASTEUROPE_CHARSET, 1250, FS(1)},
+ { RUSSIAN_CHARSET, 1251, FS(2)},
+ { GREEK_CHARSET, 1253, FS(3)},
+ { TURKISH_CHARSET, 1254, FS(4)},
+ { HEBREW_CHARSET, 1255, FS(5)},
+ { ARABIC_CHARSET, 1256, FS(6)},
+ { BALTIC_CHARSET, 1257, FS(7)},
+ { VIETNAMESE_CHARSET, 1258, FS(8)},
+ /* reserved by ANSI */
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ /* ANSI and OEM */
+ { THAI_CHARSET, 874, FS(16)},
+ { SHIFTJIS_CHARSET, 932, FS(17)},
+ { GB2312_CHARSET, 936, FS(18)},
+ { HANGEUL_CHARSET, 949, FS(19)},
+ { CHINESEBIG5_CHARSET, 950, FS(20)},
+ { JOHAB_CHARSET, 1361, FS(21)},
+ /* reserved for alternate ANSI and OEM */
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { DEFAULT_CHARSET, 0, FS(0)},
+ /* reserved for system */
+ { DEFAULT_CHARSET, 0, FS(0)},
+ { SYMBOL_CHARSET, CP_SYMBOL, FS(31)},
+};
#define INITIAL_FAMILY_COUNT 64
@@ -1287,6 +1332,54 @@
return (sz.cx / 26 + 1) / 2;
}
+/*************************************************************************
+ * TranslateCharsetInfo [GDI32.@]
+ *
+ * Fills a CHARSETINFO structure for a character set, code page, or
+ * font. This allows making the correspondance between different labelings
+ * (character set, Windows, ANSI, and OEM codepages, and Unicode ranges)
+ * of the same encoding.
+ *
+ * Only one codepage will be set in lpCs->fs. If TCI_SRCFONTSIG is used,
+ * only one codepage should be set in *lpSrc.
+ *
+ * RETURNS
+ * TRUE on success, FALSE on failure.
+ *
+ */
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+TranslateCharsetInfo(
+ LPDWORD lpSrc, /* [in]
+ if flags == TCI_SRCFONTSIG: pointer to fsCsb of a FONTSIGNATURE
+ if flags == TCI_SRCCHARSET: a character set value
+ if flags == TCI_SRCCODEPAGE: a code page value
+ */
+ LPCHARSETINFO lpCs, /* [out] structure to receive charset information */
+ DWORD flags /* [in] determines interpretation of lpSrc */)
+{
+ int index = 0;
+ switch (flags) {
+ case TCI_SRCFONTSIG:
+ while (!(*lpSrc>>index & 0x0001) && index<MAXTCIINDEX) index++;
+ break;
+ case TCI_SRCCODEPAGE:
+ while (PtrToUlong(lpSrc) != FONT_tci[index].ciACP && index <
MAXTCIINDEX) index++;
+ break;
+ case TCI_SRCCHARSET:
+ while (PtrToUlong(lpSrc) != FONT_tci[index].ciCharset && index <
MAXTCIINDEX) index++;
+ break;
+ default:
+ return FALSE;
+ }
+ if (index >= MAXTCIINDEX || FONT_tci[index].ciCharset == DEFAULT_CHARSET) return
FALSE;
+ memcpy(lpCs, &FONT_tci[index], sizeof(CHARSETINFO));
+ return TRUE;
+}
+
/*
* @unimplemented
Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdibad.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdibad.h Sun Nov 4 03:55:28 2007
@@ -59,15 +59,6 @@
DWORD Size
);
-/* Should be using NtGdiEnumFontChunk */
-BOOL
-NTAPI
-NtGdiTranslateCharsetInfo(
- PDWORD Src,
- LPCHARSETINFO CSI,
- DWORD Flags
-);
-
/* The gdi32 call does all the work in user-mode, save for NtGdiMakeFontDir */
BOOL
NTAPI
Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/text.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/text.c Sun Nov 4 03:55:28 2007
@@ -646,28 +646,6 @@
return TRUE;
}
-BOOL STDCALL
-NtGdiTranslateCharsetInfo(PDWORD Src,
- LPCHARSETINFO UnsafeCs,
- DWORD Flags)
-{
- CHARSETINFO Cs;
- BOOLEAN Ret;
- NTSTATUS Status;
-
- Ret = IntTranslateCharsetInfo(Src, &Cs, Flags);
- if (Ret)
- {
- Status = MmCopyToCaller(UnsafeCs, &Cs, sizeof(CHARSETINFO));
- if (! NT_SUCCESS(Status))
- {
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
- }
-
- return (BOOL) Ret;
-}
static void FASTCALL
FillTM(TEXTMETRICW *TM, FT_Face Face, TT_OS2 *pOS2, TT_HoriHeader *pHori)
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/w32ksvc.db (original)
+++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db Sun Nov 4 03:55:28 2007
@@ -696,7 +696,6 @@
NtGdiSetWindowExtEx 4
NtGdiSetWindowOrgEx 4
NtGdiStretchDIBits 13
-NtGdiTranslateCharsetInfo 3
NtGdiUpdateICMRegKey 4
NtUserBuildMenuItemList 4
NtUserCreateCursorIconHandle 2