Added support for specifying an stdcall dll entry point.

diff --git a/dlls/Makedll.rules.in b/dlls/Makedll.rules.in
index 6f422fd..863ccec 100644
--- a/dlls/Makedll.rules.in
+++ b/dlls/Makedll.rules.in
@@ -42,7 +42,7 @@
 # Rules for .dll files
 
 $(MODULE): $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) $(IMPORTLIBS) Makefile.in
-	$(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(DLLMAIN:%=--entry %) -L$(DLLDIR) $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
+	$(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(DLLMAIN:%=--entry _%) -L$(DLLDIR) $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
 
 $(SPEC_DEF): $(WINEBUILD)
 
diff --git a/dlls/user/Makefile.in b/dlls/user/Makefile.in
index 21b9e1d..682c16d 100644
--- a/dlls/user/Makefile.in
+++ b/dlls/user/Makefile.in
@@ -4,10 +4,10 @@
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = user32.dll
-IMPORTS   = gdi32 advapi32 kernel32
+IMPORTS   = gdi32 advapi32 kernel32 ntdll
 ALTNAMES  = user.exe keyboard.dll ddeml.dll display.dll mouse.dll
 EXTRALIBS = $(LIBUNICODE)
-DLLMAIN   = UserClientDllInitialize
+DLLMAIN   = UserClientDllInitialize@12
 
 LDDLLFLAGS = @LDDLLFLAGS@
 SYMBOLFILE = $(MODULE).tmp.o
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index 57fb2d3..5c254e0 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -212,7 +212,7 @@
 /* parse options from the argv array and remove all the recognized ones */
 static char **parse_options( int argc, char **argv )
 {
-    const char *p;
+    char *p;
     int optc;
 
     while ((optc = getopt_long( argc, argv, short_options, long_options, NULL )) != -1)
@@ -257,6 +257,7 @@
             break;
         case 'e':
             init_func = xstrdup( optarg );
+            if ((p = strchr( init_func, '@' ))) *p = 0;  /* kill stdcall decoration */
             break;
         case 'f':
             if (!strcmp( optarg, "PIC") || !strcmp( optarg, "pic")) UsePIC = 1;