diff --git a/.gitignore b/.gitignore index c15e617636a..b57ea5417f0 100644 --- a/.gitignore +++ b/.gitignore @@ -135,6 +135,7 @@ dlls/rpcrt4/tests/server.h dlls/rpcrt4/tests/server_c.c dlls/rpcrt4/tests/server_s.c dlls/shdocvw/shdocvw_v1.tlb +dlls/shell32/AUTHORS dlls/stdole2.tlb/std_ole_v2.tlb dlls/stdole32.tlb/std_ole_v1.tlb dlls/sti/sti_wia.h diff --git a/Makefile.in b/Makefile.in index f8d760d641c..eec29bcb9f3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -73,6 +73,8 @@ tools/wmc tools/wrc: tools tools tools/wmc tools/wrc: libs/wine tools/widl tools/wmc tools/wrc: libs/wpp +dlls/shell32/Makefile dlls/shell32/__depend__: dlls/shell32/AUTHORS + $(MAKEDEP): include/config.h tools/Makefile @cd $(TOOLSDIR)/tools && $(MAKE) makedep$(TOOLSEXT) diff --git a/configure b/configure index 4d89bd831ab..9b1cb220f2a 100755 --- a/configure +++ b/configure @@ -14569,6 +14569,8 @@ then "crosstest: @echo \"crosstest is not supported (mingw not installed?)\" && false" fi +ac_config_links="$ac_config_links dlls/shell32/AUTHORS:AUTHORS" +wine_fn_config_symlink dlls/shell32/AUTHORS ac_config_links="$ac_config_links dlls/wineps.drv/generic.ppd:dlls/wineps.drv/generic.ppd" test "$srcdir" = "." || wine_fn_config_symlink dlls/wineps.drv/generic.ppd if test "x$enable_fonts" != xno; then @@ -15962,6 +15964,7 @@ do case $ac_config_target in "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; "include/stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/stamp-h" ;; + "dlls/shell32/AUTHORS") CONFIG_LINKS="$CONFIG_LINKS dlls/shell32/AUTHORS:AUTHORS" ;; "dlls/wineps.drv/generic.ppd") CONFIG_LINKS="$CONFIG_LINKS dlls/wineps.drv/generic.ppd:dlls/wineps.drv/generic.ppd" ;; "fonts/marlett.ttf") CONFIG_LINKS="$CONFIG_LINKS fonts/marlett.ttf:fonts/marlett.ttf" ;; "fonts/symbol.ttf") CONFIG_LINKS="$CONFIG_LINKS fonts/symbol.ttf:fonts/symbol.ttf" ;; diff --git a/configure.ac b/configure.ac index f0ebc03eb17..04ed14f3639 100644 --- a/configure.ac +++ b/configure.ac @@ -2263,6 +2263,7 @@ AH_BOTTOM([#endif /* WINE_CROSSTEST */]) AC_CONFIG_COMMANDS([include/stamp-h], [echo timestamp > include/stamp-h]) +WINE_CONFIG_SYMLINK(dlls/shell32/AUTHORS,AUTHORS) WINE_CONFIG_SYMLINK(dlls/wineps.drv/generic.ppd) WINE_CONFIG_SYMLINK(fonts/marlett.ttf,,enable_fonts) WINE_CONFIG_SYMLINK(fonts/symbol.ttf,,enable_fonts) diff --git a/dlls/shell32/.gitignore b/dlls/shell32/.gitignore deleted file mode 100644 index a6683e2759f..00000000000 --- a/dlls/shell32/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/authors.c diff --git a/dlls/shell32/Makefile.in b/dlls/shell32/Makefile.in index a101c750729..1997c015932 100644 --- a/dlls/shell32/Makefile.in +++ b/dlls/shell32/Makefile.in @@ -106,14 +106,4 @@ SVG_SRCS = \ shortcut.svg \ trash_file.svg -EXTRA_OBJS = authors.o - @MAKE_DLL_RULES@ - -authors.c: $(top_srcdir)/AUTHORS - (LC_ALL=C; export LC_ALL; echo 'const char * const SHELL_Authors[] = {' && \ - sed -e '1,2d' -e 's/\(.*\)/ \"\1\",/' $(top_srcdir)/AUTHORS && \ - echo ' 0 };') >$@ || ($(RM) $@ && false) - -clean:: - $(RM) authors.c diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index 7d78ab5d576..227b63e9d2c 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -51,8 +51,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -extern const char * const SHELL_Authors[]; - /************************************************************************* * CommandLineToArgvW [SHELL32.@] * @@ -932,6 +930,34 @@ HRESULT WINAPI SHLoadInProc (REFCLSID rclsid) return DISP_E_MEMBERNOTFOUND; } +static void add_authors( HWND list ) +{ + static const WCHAR eol[] = {'\r','\n',0}; + static const WCHAR authors[] = {'A','U','T','H','O','R','S',0}; + WCHAR *strW, *start, *end; + HRSRC rsrc = FindResourceW( shell32_hInstance, authors, (LPCWSTR)RT_RCDATA ); + char *strA = LockResource( LoadResource( shell32_hInstance, rsrc )); + DWORD sizeW, sizeA = SizeofResource( shell32_hInstance, rsrc ); + + if (!strA) return; + sizeW = MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, NULL, 0 ) + 1; + if (!(strW = HeapAlloc( GetProcessHeap(), 0, sizeW * sizeof(WCHAR) ))) return; + MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, strW, sizeW ); + strW[sizeW - 1] = 0; + + start = strpbrkW( strW, eol ); /* skip the header line */ + while (start) + { + while (*start && strchrW( eol, *start )) start++; + if (!*start) break; + end = strpbrkW( start, eol ); + if (end) *end++ = 0; + SendMessageW( list, LB_ADDSTRING, -1, (LPARAM)start ); + start = end; + } + HeapFree( GetProcessHeap(), 0, strW ); +} + /************************************************************************* * AboutDlgProc (internal) */ @@ -952,7 +978,6 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, if (info) { - const char* const *pstr = SHELL_Authors; SendDlgItemMessageW(hWnd, stc1, STM_SETICON,(WPARAM)info->hIcon, 0); GetWindowTextW( hWnd, template, sizeof(template)/sizeof(WCHAR) ); sprintfW( buffer, template, info->szApp ); @@ -968,13 +993,7 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, hWndCtl = GetDlgItem(hWnd, IDC_ABOUT_LISTBOX); SendMessageW( hWndCtl, WM_SETREDRAW, 0, 0 ); SendMessageW( hWndCtl, WM_SETFONT, (WPARAM)info->hFont, 0 ); - while (*pstr) - { - /* authors list is in utf-8 format */ - MultiByteToWideChar( CP_UTF8, 0, *pstr, -1, buffer, sizeof(buffer)/sizeof(WCHAR) ); - SendMessageW( hWndCtl, LB_ADDSTRING, -1, (LPARAM)buffer ); - pstr++; - } + add_authors( hWndCtl ); SendMessageW( hWndCtl, WM_SETREDRAW, 1, 0 ); } } diff --git a/dlls/shell32/shres.rc b/dlls/shell32/shres.rc index 11cc344c729..6ff4d98a13f 100644 --- a/dlls/shell32/shres.rc +++ b/dlls/shell32/shres.rc @@ -125,3 +125,6 @@ IDR_AVI_FILENUKE AVI searching.avi /* @makedep: searching.avi */ IDR_AVI_FILEDELETE AVI searching.avi + +/* @makedep: AUTHORS */ +AUTHORS RCDATA AUTHORS diff --git a/tools/make_makefiles b/tools/make_makefiles index 4673fea2f70..7084258d0a7 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -90,6 +90,7 @@ my @ignores = ( "Makefile", "dlldata.c", "dlls/*/*.def", + "dlls/shell32/AUTHORS", "*/*/tests/*crosstest.exe", "*/*/tests/testlist.c", "include/config.h",