[RFC] __WINESRC__ & public headers

Alexandre Julliard julliard at winehq.com
Sun Jan 5 20:38:28 CST 2003


"Dimitrie O. Paun" <dpaun at rogers.com> writes:

> OK, but my problem is that we defined them on the #ifdef __WINESRC__.
> Which means our code will fail with other headers (even though, granted
> the fix is trivial). But I'm thinking, wouldn't it better to explicitely
> define these in the files that need it?

Yes that would probably be better.

> Yay! Can you please suggest a solution / comment on my comments :)?
> Here they are again:
> 
> include/rpcproxy.h:#if defined(__WINESRC__) && defined(__WINE_WINE_OBJ_OLEAUT_H)
> include/rpcproxy.h-/* see http://msdn.microsoft.com/library/en-us/dnmsj99/html/com0199.asp?frame=true */
> include/rpcproxy.h-
> include/rpcproxy.h-RPCRTAPI HRESULT RPC_ENTRY
> include/rpcproxy.h-  CreateProxyFromTypeInfo( LPTYPEINFO pTypeInfo, LPUNKNOWN pUnkOuter, REFIID riid,
> include/rpcproxy.h-                           LPRPCPROXYBUFFER *ppProxy, LPVOID *ppv );
> include/rpcproxy.h-RPCRTAPI HRESULT RPC_ENTRY
> include/rpcproxy.h-  CreateStubFromTypeInfo( LPTYPEINFO pTypeInfo, REFIID riid, LPUNKNOWN pUnkServer,
> include/rpcproxy.h-                          LPRPCSTUBBUFFER *ppStub );
> include/rpcproxy.h-
> include/rpcproxy.h-#endif

This can probably be removed/commented out.

> -- Seems like it wants moving to a wine/base.h
> include/winbase.h:#ifdef __WINESRC__
> include/winbase.h-#define CRITICAL_SECTION_INIT(name) { (void *)(__FILE__ ": " name), -1, 0, 0, 0, 0 }
> include/winbase.h-#endif

This could be removed and replaced by explicit initializations in the
files that need it.

> include/winnt.h:#ifdef __WINESRC__
> include/winnt.h-
> include/winnt.h-/* Macros to retrieve the current context */
> include/winnt.h-
> include/winnt.h-#ifdef __i386__
> include/winnt.h-
> include/winnt.h-#define _DEFINE_REGS_ENTRYPOINT( name, fn, args ) \
> include/winnt.h-    __ASM_GLOBAL_FUNC( name, \
> include/winnt.h-                       "call " __ASM_NAME("__wine_call_from_32_regs") "\n\t" \
> include/winnt.h-                       ".long " __ASM_NAME(#fn) "\n\t" \
> include/winnt.h-                       ".byte " #args ", " #args )

This one will need to be moved, and probably reworked a bit. I'll look
into doing that.

> -- What about these?
> include/wownt32.h:#ifdef __WINESRC__
> include/wownt32.h-/* under Wine use the kernel functions directly so we don't have to import wow32 */
> include/wownt32.h-HANDLE WINAPI K32WOWHandle32(WORD,WOW_HANDLE_TYPE);
> include/wownt32.h-WORD   WINAPI K32WOWHandle16(HANDLE,WOW_HANDLE_TYPE);
> include/wownt32.h-#define WOWHandle32 K32WOWHandle32
> include/wownt32.h-#define WOWHandle16 K32WOWHandle16
> include/wownt32.h-#endif

That's just an optimization, it shouldn't matter.

> -- It seems to me we want to move these to a wine/multimedia.h header.
> include/mmddk.h:#ifdef __WINESRC__
> include/mmddk.h-#define DRV_QUERYDSOUNDIFACE    (DRV_RESERVED + 10)
> include/mmddk.h-#endif
> 
> include/mmsystem.h:#ifdef __WINESRC__
> include/mmsystem.h-/* this call (GetDriverFlags) is not documented, nor the flags returned.
> include/mmsystem.h- * here are Wine only definitions
> include/mmsystem.h- */
> include/mmsystem.h-#define WINE_GDF_EXIST       0x80000000
> include/mmsystem.h-#define WINE_GDF_16BIT       0x10000000
> include/mmsystem.h-#endif
> 
> include/mmsystem.h:#ifdef __WINESRC__
> include/mmsystem.h-#define  WAVE_DIRECTSOUND               0x0080
> include/mmsystem.h-#endif
> 
> -- These want moving to a wine-private header (wine/base.h?)
> include/winnt.h:#ifdef __WINESRC__
> include/winnt.h-#define MEM_SYSTEM              0x80000000
> include/winnt.h-#endif
> 
> include/winsock.h:#ifdef __WINESRC__
> include/winsock.h-#define FD_WINE_LISTENING          0x10000000
> include/winsock.h-#define FD_WINE_NONBLOCKING        0x20000000
> include/winsock.h-#define FD_WINE_CONNECTED          0x40000000
> include/winsock.h-#define FD_WINE_RAW                0x80000000
> include/winsock.h-#define FD_WINE_INTERNAL           0xFFFF0000
> include/winsock.h-#endif

For all of these the code probably needs to be redesigned to not
require API extensions. I don't know how, each one must be studied in
detail. And there are probably other places where we have added
Wine-specific flags without __WINESRC__ that will need to be fixed
too.

-- 
Alexandre Julliard
julliard at winehq.com



More information about the wine-devel mailing list