Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Win32 API on Linux

988 views
Skip to first unread message

gleaves@hotmail.com > <hugh<underbar>

unread,
Mar 17, 2010, 12:45:02 PM3/17/10
to
I'm trying to find out if anyone has created a library of Win32-like
functions that run on Linux.

The idea being I have some C code, calls a load of NT stuff like
CreateFileMapping, CreateFile, OpenMutex and many other old favorites.

I'd like to "simply" port the src code, compile and like with some
"win32_linux" library and hey-presto she runs.

I doubt that this is possible, but what do you guys think?

Thanks

Hugh

Darko Miletic

unread,
Mar 17, 2010, 1:23:25 PM3/17/10
to Hugo gleaves@hotmail.com> <hugh

It is not possible. However on linux there is windows emulation software
- wine which you can use to run windows apps. See http://www.winehq.org/.

Darko Miletic

unread,
Mar 17, 2010, 1:23:53 PM3/17/10
to Hugo gleaves@hotmail.com> <hugh

It is not possible. However on linux there is windows emulation software

Darko Miletic

unread,
Mar 17, 2010, 1:24:47 PM3/17/10
to

It is not possible. However on linux there is windows emulation software

Nobody

unread,
Mar 17, 2010, 3:33:42 PM3/17/10
to
"Hugo gle...@hotmail.com>" <hugh<underbar> wrote in message
news:9B9A9180-2C9A-4A71...@microsoft.com...

You don't need to do a thing:

http://en.wikipedia.org/wiki/Wine_(software)

It redirects the calls to Linux equivalent, so OS functions run at full
speed, so there is just the call translation overhead to worry about.


Jonathan de Boyne Pollard

unread,
Mar 17, 2010, 4:43:45 PM3/17/10
to

>
>
> It is not possible. However on linux there is windows emulation
> software - wine which you can use to run windows apps. See
> http://www.winehq.org/.
>
A statement that it isn't possible and a pointer to the place where a
library can be found that does the very thing asked for, pretty much in
the same breath. You've read the WWW site that you're pointing to,
right? (-:

Stefan Kuhr

unread,
Mar 18, 2010, 5:02:30 AM3/18/10
to

Hi Hugo,


A few others have pointed you to the Wine project. As they have pointed
out, Wine is a fine environment to run your binaries that have been
compiled for x86 Windows on an x86 Linux box (an x64 port of Wine is
currently in development, but I haven't yet tried it). You should give
that a try, I always find it surprising how much of Win32 actually works
on Wine.

But using winelib, you can also achieve what you *really* want: Take
your Win32 code and compile it with gcc and link against winelib. This
will give you a native executable that doesn't require Wine to be
installed on client linux boxes.

However, things could get somewhat problematic if your code is more than
plain Win32 without libraries licensed from MS: IANAL, so I don't know
if there are licensing issues if your code uses MFC or ATL and you have
to create an equivalent of mfcxx.dll or nafxcw.lib using winelib.

--
S

gleaves@hotmail.com > <hugh<underbar>

unread,
Mar 18, 2010, 11:02:01 AM3/18/10
to

"Stefan Kuhr" wrote:

> .
>

Hmm, I wonder if winelib provides any of the "undocumented" NT calls like
those used for manipulating kernel namespaces and stuff?

I guess there is a list of supported functions, so let me look...

Hugh

Stefan Kuhr

unread,
Mar 19, 2010, 5:00:37 AM3/19/10
to
Hi Hugo,

On 3/18/2010 4:02 PM, Hugo gle...@hotmail.com> <hugh wrote:
> <snip>


> Hmm, I wonder if winelib provides any of the "undocumented" NT calls like
> those used for manipulating kernel namespaces and stuff?
>
> I guess there is a list of supported functions, so let me look...
>

My understanding is that winelib exposes the exact same functionality as
a wine build of the same version does, because they share the same code.
So I would expect that if your app fails to run under Wine, it will also
not work when built natively against winelib. So simply try your
existing build on a current build of Wine and see if it works. My
recommendation is to download and build the latest build (1.1.40) on
your own and not necessarily use an older version that is among those
that can be installed from the package manager of your Linux distro.

--
S

0 new messages