Commit in reactos on MAIN
lib/cabinet/.cvsignore+11.2 -> 1.3
lib/comctl32/.cvsignore+11.6 -> 1.7
lib/comdlg32/.cvsignore+11.2 -> 1.3
lib/iphlpapi/.cvsignore+11.3 -> 1.4
lib/mpr/.cvsignore+11.1 -> 1.2
lib/msacm/.cvsignore+11.2 -> 1.3
lib/msvideo/.cvsignore+11.2 -> 1.3
lib/netapi32/.cvsignore+11.3 -> 1.4
lib/ole32/.cvsignore+11.4 -> 1.5
lib/oleaut32/.cvsignore+11.4 -> 1.5
lib/oledlg/.cvsignore+11.2 -> 1.3
lib/richedit/.cvsignore+2-11.2 -> 1.3
lib/rpcrt4/.cvsignore+11.3 -> 1.4
lib/setupapi/.cvsignore+11.1 -> 1.2
lib/shell32/.cvsignore+11.6 -> 1.7
lib/shlwapi/.cvsignore+11.2 -> 1.3
lib/unicode/Makefile.ros-template+3-11.2 -> 1.3
lib/winmm/.cvsignore+2-11.4 -> 1.5
tools/helper.mk+11-51.93 -> 1.94
tools/winebuild/build.h+11.2 -> 1.3
               /main.c+17-31.4 -> 1.5
               /spec32.c+35-41.6 -> 1.7
+86-15
22 modified files
Generate stub functions from .spec file

reactos/lib/cabinet
.cvsignore 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	16 Jan 2004 13:08:56 -0000	1.2
+++ .cvsignore	2 Nov 2004 19:47:16 -0000	1.3
@@ -8,3 +8,4 @@
 *.tmp
 Makefile.ros
 cabinet.spec.def
+cabinet.stubs.c

reactos/lib/comctl32
.cvsignore 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- .cvsignore	19 Sep 2004 09:50:05 -0000	1.6
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.7
@@ -23,3 +23,4 @@
 idi_tt_warn_sm.ico
 idt_check.bmp
 comctl32.spec.def
+comctl32.stubs.c

reactos/lib/comdlg32
.cvsignore 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	13 Jan 2004 17:19:28 -0000	1.2
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.3
@@ -10,3 +10,4 @@
 *.bmp
 *.ico
 comdlg32.spec.def
+comdlg32.stubs.c
\ No newline at end of file

reactos/lib/iphlpapi
.cvsignore 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- .cvsignore	4 Mar 2004 23:26:36 -0000	1.3
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.4
@@ -19,3 +19,4 @@
 *.tmp
 Makefile.ros
 iphlpapi.spec.def
+iphlpapi.stubs.c

reactos/lib/mpr
.cvsignore 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	1 Feb 2004 19:58:55 -0000	1.1
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.2
@@ -8,3 +8,4 @@
 *.tmp
 Makefile.ros
 mpr.spec.def
+mpr.stubs.c

reactos/lib/msacm
.cvsignore 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	2 Aug 2004 15:07:09 -0000	1.2
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.3
@@ -9,3 +9,4 @@
 temp.exp
 msacm32.spec.def
 Makefile.ros
+msacm32.stubs.c

reactos/lib/msvideo
.cvsignore 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	2 Aug 2004 03:04:40 -0000	1.2
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.3
@@ -7,3 +7,4 @@
 *.tmp
 Makefile.ros
 msvfw32.spec.def
+msvfw32.stubs.c

reactos/lib/netapi32
.cvsignore 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- .cvsignore	7 Apr 2004 17:45:05 -0000	1.3
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.4
@@ -8,3 +8,4 @@
 *.tmp
 Makefile.ros
 netapi32.spec.def
+netapi32.stubs.c

reactos/lib/ole32
.cvsignore 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- .cvsignore	2 Jan 2004 19:49:45 -0000	1.4
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.5
@@ -12,3 +12,4 @@
 drag_move.cur
 nodrop.cur 
 ole32.spec.def
+ole32.stubs.c

reactos/lib/oleaut32
.cvsignore 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- .cvsignore	7 Feb 2004 18:53:58 -0000	1.4
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.5
@@ -7,3 +7,4 @@
 *.tmp
 Makefile.ros
 oleaut32.spec.def
+oleaut32.stubs.c

reactos/lib/oledlg
.cvsignore 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	16 Jan 2004 13:08:56 -0000	1.2
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.3
@@ -8,3 +8,4 @@
 *.tmp
 Makefile.ros
 oledlg.spec.def
+oledlg.stubs.c

reactos/lib/richedit
.cvsignore 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	1 Feb 2004 21:26:06 -0000	1.2
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.3
@@ -7,4 +7,5 @@
 *.map
 *.tmp
 Makefile.ros
-riched32.spec.def
\ No newline at end of file
+riched32.spec.def
+riched32.stubs.c

reactos/lib/rpcrt4
.cvsignore 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- .cvsignore	4 May 2004 20:10:07 -0000	1.3
+++ .cvsignore	2 Nov 2004 19:47:17 -0000	1.4
@@ -8,3 +8,4 @@
 *.tmp
 Makefile.ros
 rpcrt4.spec.def
+rpcrt4.stubs.c

reactos/lib/setupapi
.cvsignore 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	28 Jan 2004 21:56:36 -0000	1.1
+++ .cvsignore	2 Nov 2004 19:47:18 -0000	1.2
@@ -8,3 +8,4 @@
 *.tmp
 Makefile.ros
 setupapi.spec.def
+setupapi.stubs.c

reactos/lib/shell32
.cvsignore 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- .cvsignore	1 Aug 2004 22:00:33 -0000	1.6
+++ .cvsignore	2 Nov 2004 19:47:18 -0000	1.7
@@ -10,3 +10,4 @@
 *.ico
 shell32.spec.def
 authors.c
+shell32.stubs.c

reactos/lib/shlwapi
.cvsignore 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	2 Jan 2004 19:49:46 -0000	1.2
+++ .cvsignore	2 Nov 2004 19:47:18 -0000	1.3
@@ -8,3 +8,4 @@
 *.tmp
 Makefile.ros
 shlwapi.spec.def
+shlwapi.stubs.c

reactos/lib/unicode
Makefile.ros-template 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- Makefile.ros-template	29 May 2004 21:24:47 -0000	1.2
+++ Makefile.ros-template	2 Nov 2004 19:47:18 -0000	1.3
@@ -1,4 +1,4 @@
-# $Id: Makefile.ros-template,v 1.2 2004/05/29 21:24:47 hbirr Exp $
+# $Id: Makefile.ros-template,v 1.3 2004/11/02 19:47:18 gvg Exp $
 
 TARGET_NAME = libwine_unicode
 
@@ -27,6 +27,8 @@
 
 TARGET_DEFNAME = wine_unicode
 
+TARGET_STUBS = no
+
 default: all
 
 DEP_OBJECTS = $(TARGET_OBJECTS)

reactos/lib/winmm
.cvsignore 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- .cvsignore	25 Feb 2004 22:33:35 -0000	1.4
+++ .cvsignore	2 Nov 2004 19:47:18 -0000	1.5
@@ -5,4 +5,5 @@
 *.d
 *.sym
 *.map
-*.spec.def
\ No newline at end of file
+*.spec.def
+winmm.stubs.c

reactos/tools
helper.mk 1.93 -> 1.94
diff -u -r1.93 -r1.94
--- helper.mk	28 Oct 2004 19:01:59 -0000	1.93
+++ helper.mk	2 Nov 2004 19:47:18 -0000	1.94
@@ -1,4 +1,4 @@
-# $Id: helper.mk,v 1.93 2004/10/28 19:01:59 chorns Exp $
+# $Id: helper.mk,v 1.94 2004/11/02 19:47:18 gvg Exp $
 #
 # Helper makefile for ReactOS modules
 # Variables this makefile accepts:
@@ -486,6 +486,10 @@
 else
   MK_DEFBASENAME := $(TARGET_DEFNAME)
 endif
+ifneq ($(TARGET_STUBS),no)
+  MK_STUBS_SRC := $(TARGET_NAME).stubs.c
+  MK_STUBS_OBJ := $(TARGET_NAME).stubs.o
+endif
   MK_RC_BINARIES = $(TARGET_RC_BINARIES)
 endif
 
@@ -667,7 +671,7 @@
 endif
 
 # We don't want to link header files
-MK_OBJECTS := $(filter-out %.h,$(TARGET_OBJECTS))
+MK_OBJECTS := $(filter-out %.h,$(TARGET_OBJECTS)) $(MK_STUBS_OBJ)
 
 # There is problems with C++ applications and ld -r. Ld can cause errors like:
 #   reloc refers to symbol `.text$_ZN9CCABCodecC2Ev' which is not being output
@@ -724,7 +728,7 @@
 $(MK_BASENAME).a: $(MK_OBJECTS)
 	$(AR) -rc $(MK_BASENAME).a $(MK_OBJECTS)
 
-$(MK_NOSTRIPNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS)
+$(MK_NOSTRIPNAME): $(MK_EXTRADEP) $(MK_FULLRES) $(MK_BASENAME).a $(MK_LIBS) $(MK_STUBS_SRC) $(MK_STUBS_OBJ)
 ifeq ($(MK_EXETYPE),dll)
 	$(LD_CC) -Wl,--base-file,base.tmp \
 		-Wl,--entry,$(TARGET_ENTRY) \
@@ -946,8 +950,8 @@
 clean: $(MK_REGTESTS_CLEAN) $(SUBDIRS:%=%_clean)
 	- $(RM) *.o $(MK_PCHNAME) $(MK_BASENAME).sym $(MK_BASENAME).a $(MK_RESOURCE) \
 	  $(MK_FULLNAME) $(MK_NOSTRIPNAME) $(MK_CLEANFILES) $(MK_CLEANDEPS) $(MK_BASENAME).map \
-	  junk.tmp base.tmp temp.exp $(MK_RC_BINARIES) $(MK_SPECDEF) $(MK_GENERATED_MAKEFILE) \
-	  $(TARGET_CLEAN)
+	  junk.tmp base.tmp temp.exp $(MK_RC_BINARIES) $(MK_SPECDEF) $(MK_STUBS_SRC) \
+	  $(MK_GENERATED_MAKEFILE) $(TARGET_CLEAN)
 
 ifneq ($(TARGET_HEADERS),)
 $(TARGET_OBJECTS): $(TARGET_HEADERS)
@@ -1100,6 +1104,8 @@
 	$(WINEBUILD) $(DEFS) -o $@ --def $<
 %.drv.spec.def: %.spec
 	$(WINEBUILD) $(DEFS) -o $@ --def $<
+%.stubs.c: %.spec
+	$(WINEBUILD) $(DEFS) -o $@ --pedll $<
 %.i: %.c
 	$(CC) $(TARGET_CFLAGS) -E $< > $@
 %.h.gch: %.h

reactos/tools/winebuild
build.h 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- build.h	23 Sep 2004 20:27:30 -0000	1.2
+++ build.h	2 Nov 2004 19:47:18 -0000	1.3
@@ -185,6 +185,7 @@
 extern void BuildSpec32File( FILE *outfile, DLLSPEC *spec );
 extern void BuildDef32File( FILE *outfile, DLLSPEC *spec );
 extern void BuildDebugFile( FILE *outfile, const char *srcdir, char **argv );
+extern void BuildPedllFile( FILE *outfile, DLLSPEC *spec );
 
 extern int parse_spec_file( FILE *file, DLLSPEC *spec );
 extern int parse_def_file( FILE *file, DLLSPEC *spec );

reactos/tools/winebuild
main.c 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- main.c	23 Sep 2004 20:27:30 -0000	1.4
+++ main.c	2 Nov 2004 19:47:18 -0000	1.5
@@ -74,7 +74,8 @@
     MODE_DEF,
     MODE_DEBUG,
     MODE_RELAY16,
-    MODE_RELAY32
+    MODE_RELAY32,
+    MODE_PEDLL
 };
 
 static enum exec_mode_values exec_mode = MODE_NONE;
@@ -159,7 +160,8 @@
 "       --exe=NAME           Build a .c file for the named executable\n"
 "       --debug [FILES]      Build a .c file with the debug channels declarations\n"
 "       --relay16            Build the 16-bit relay assembly routines\n"
-"       --relay32            Build the 32-bit relay assembly routines\n\n"
+"       --relay32            Build the 32-bit relay assembly routines\n"
+"       --pedll              Build a .c file for PE dll\n\n"
 "The mode options are mutually exclusive; you must specify one and only one.\n\n";
 
 enum long_options_values
@@ -171,7 +173,8 @@
     LONG_OPT_RELAY16,
     LONG_OPT_RELAY32,
     LONG_OPT_SUBSYSTEM,
-    LONG_OPT_VERSION
+    LONG_OPT_VERSION,
+    LONG_OPT_PEDLL
 };
 
 static const char short_options[] = "C:D:F:H:I:K:L:M:N:d:e:f:hi:kl:m:o:r:w";
@@ -186,6 +189,7 @@
     { "relay32",  0, 0, LONG_OPT_RELAY32 },
     { "subsystem",1, 0, LONG_OPT_SUBSYSTEM },
     { "version",  0, 0, LONG_OPT_VERSION },
+    { "pedll",    1, 0, LONG_OPT_PEDLL },
     /* aliases for short options */
     { "source-dir",    1, 0, 'C' },
     { "delay-lib",     1, 0, 'd' },
@@ -341,6 +345,11 @@
         case LONG_OPT_VERSION:
             printf( "winebuild version " PACKAGE_VERSION "\n" );
             exit(0);
+        case LONG_OPT_PEDLL:
+            set_exec_mode( MODE_PEDLL );
+            spec_file_name = xstrdup( optarg );
+            set_dll_file_name( optarg, spec );
+            break;
         case '?':
             usage(1);
             break;
@@ -442,6 +451,11 @@
     case MODE_RELAY32:
         fatal_error( "Win32 relays are not supported in ReactOS version of winebuild\n" );
         break;
+    case MODE_PEDLL:
+        if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] );
+        if (!parse_input_file( spec )) break;
+        BuildPedllFile( output_file, spec );
+        break;
     default:
         usage(1);
         break;

reactos/tools/winebuild
spec32.c 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- spec32.c	23 Sep 2004 20:27:30 -0000	1.6
+++ spec32.c	2 Nov 2004 19:47:18 -0000	1.7
@@ -851,12 +851,10 @@
         int is_data = 0;
 
         if (!odp) continue;
-        if (odp->flags & FLAG_REGISTER) continue;
-        if (odp->type == TYPE_STUB) continue;
-
         if (odp->name) name = odp->name;
+        else if (odp->type == TYPE_STUB) name = make_internal_name( odp, spec, "stub" );
         else if (odp->export_name) name = odp->export_name;
-        else continue;
+        else name = make_internal_name( odp, spec, "noname_export" );
 
         fprintf(outfile, "  %s", name);
 
@@ -886,11 +884,23 @@
             }
             break;
         }
+        case TYPE_STUB:
+        {
+            if (NULL != odp->name)
+            {
+                fprintf(outfile, "=%s", make_internal_name( odp, spec, "stub" ));
+            }
+            break;
+        }
         default:
             assert(0);
         }
         fprintf( outfile, " @%d", odp->ordinal );
+#if 0 /* MinGW binutils cannot handle this correctly */
         if (!odp->name) fprintf( outfile, " NONAME" );
+#else
+        if (!odp->name && (odp->type == TYPE_STUB || odp->export_name)) fprintf( outfile, " NONAME" );
+#endif
         if (is_data) fprintf( outfile, " DATA" );
 #if 0
         /* MinGW binutils cannot handle this correctly */
@@ -994,3 +1004,24 @@
 
     free( prefix );
 }
+
+
+/*******************************************************************
+ *         BuildPedllFile
+ *
+ * Build a PE DLL C file from a spec file.
+ */
+void BuildPedllFile( FILE *outfile, DLLSPEC *spec )
+{
+    int nr_exports;
+
+    nr_exports = spec->base <= spec->limit ? spec->limit - spec->base + 1 : 0;
+    output_standard_file_header( outfile );
+
+    if (nr_exports)
+    {
+        /* Output the stub functions */
+
+        output_stub_funcs( outfile, spec );
+    }
+}
CVSspam 0.2.8