[ros-bugs] [Bug 5640] PATCH: mui: support function stubs

ReactOS.Bugzilla at reactos.org ReactOS.Bugzilla at reactos.org
Tue Sep 28 21:11:18 UTC 2010


http://www.reactos.org/bugzilla/show_bug.cgi?id=5640





--- Comment #8 from ehasis <ehasis at hotmail.com>  2010-09-28 21:11:17 CET ---
(In reply to comment #7)
> 1. What are those ZZ types, where do they come from? Google search for them
> shows nearly no results.

They come from Vista's winnt.h. If you look for example on this API
http://msdn.microsoft.com/en-US/library/dd318115.aspx you will find that it
uses one of those ZZ types. I don't really know why they defined those types,
but they are used on MUI api functions.

On Vista's wintn.h they are declared as, for example:
typedef __nullnullterminated WCHAR *PZZWSTR;

where __nullnullterminated is defined as:
#define __nullnullterminated     __allowed(on_typedecl)

The curious is that for example they declare:
typedef __nullterminated WCHAR *NWPSTR, *LPWSTR, *PWSTR;

and define __nullterminated exactly as the previous one:
#define __nullterminated         __allowed(on_typedecl)



> 2. Maybe it's better to add those stubs to new file mui.c instead, what do you
> think?

I think it's a good idea. In fact I started doing in that way, but later I
thought that using the already existent file (lang.c) was the correct way to
handle it. Was not sure about the impact of creating a new file in the repo.

> 3. You seem to have knowledge how MUI works, can you tell me very briefly about
> 2003 and Vista+ models? Generally we target 2003 everywhere, but I think this
> one could be an exception from this rule.

Sure thing, is not much deeply, but I'll try.

Before Vista, the way used to localize files was as we used to see, one binary
for each language (window's model) or many languages on the same binary
(wine/ros model). When I say binary, I'm talking the final exe or dll. That's
why you don't have language packs on windows xp, you have to install the whole
OS in the language that you want.

With Windows vista, they basically created a way to split the localized
resources in many files. The main binary file, i.e. notepad.exe, contains the
language neutral resources and <lang-name>\notepad.exe.mui contains the
localized resources. These .mui files are normal PE files.

If you, for example, use this code sniped:

HMODULE hResModule = LoadLibraryEx(TEXT("notepad.exe"), 0, 
    LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE);

The OS will load the correspondent .mui file, for example:
pt-BR\notepad.exe.mui

The MUI system use some kind of fallback to find an appropriate mui, for
example, if the system language is Catalan, and he not finds the es-CA file, he
tries es-ES, if not find again, he then back to en-US or just use the LN file.

So, to implement the MUI support is not only implement those API function, in
fact they are pretty trivial (in therms of what they do), but also figure out
how to automatically handle the mui's resource loading.

I don't know if I was clear enough with my "broken english", but the link
bellow have good briefly talking more of less the same thing.

Evolution of MUI Support across Windows Versions
http://msdn.microsoft.com/en-US/library/ee264317.aspx


-- 
Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Ros-bugs mailing list