Alexandre Julliard wrote:
Which of course demonstrates that gdi32 calls usp10 on native too. Maybe
it does it indirectly through lpk.dll, but the end result is the same,
you have a dependency on usp10.

  
I know I'm coming a bit late into the discussion, but just for the record, this is how Windows does it (as of Windows 2000):

I believe the reason for this twisted design is twofold. First, in Windows 2000, CTL (complex text layout) was an optional component, to be installed by a checkbox in the regional settings dialog. This meant that the entire LPK dll could just be dropped in, along with some fonts, and the system would start supporting BiDi. The second reason is because BiDi is a rather multi-layered process. With BiDi, support for multi line rendering (as done by DrawText in User32) requires some fairly complex processing before the text could be passed off to ExtTextOut for actual rendering. This way, all the BiDi code could be placed in one place.

Another reason, I believe, for this separation is that pre-Windows 2000 (and more importantly, pre-uniscribe) Windows still had BiDi code, which was scattered all over the place, and which became obsolete (for one example - GetCharacterPlacement, which supposedly does BiDi, has no mechanism to choose the paragraph direction, without which no BiDi processing makes sense. The MSDN docs even explicitly state it is obsolete).

I believe the best route forward is to use an LPK like DLL. Not LPK itself, as that would require of us to reverse engineer a whole set of APIs that no one but us even call, but another DLL, injected into the dependency order at the same location, carrying a similar functionality. I would suggest "winelpk.dll" as the name, but that is, of course, entirely open.

Shachar

-- 
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com