Hans Leidekker : programs: Add a stub FontCache3.0.0.0 service.

Alexandre Julliard julliard at winehq.org
Wed Aug 24 14:05:24 CDT 2011


Module: wine
Branch: master
Commit: 8959961b425c739247f7d3ea7a56577f56cb29a2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8959961b425c739247f7d3ea7a56577f56cb29a2

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Aug 24 10:23:57 2011 +0200

programs: Add a stub FontCache3.0.0.0 service.

---

 configure                                  |    1 +
 configure.ac                               |    1 +
 programs/presentationfontcache/Makefile.in |    9 +++
 programs/presentationfontcache/main.c      |   99 ++++++++++++++++++++++++++++
 tools/wine.inf.in                          |   12 ++++
 5 files changed, 122 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 1497bdb..4d5dcb3 100755
--- a/configure
+++ b/configure
@@ -15312,6 +15312,7 @@ wine_fn_config_program notepad enable_notepad install,installbin,manpage,po
 wine_fn_config_program oleview enable_oleview install,po
 wine_fn_config_program ping enable_ping install
 wine_fn_config_program plugplay enable_plugplay install
+wine_fn_config_program presentationfontcache enable_presentationfontcache install
 wine_fn_config_program progman enable_progman install,po
 wine_fn_config_program reg enable_reg install,po
 wine_fn_config_program regedit enable_regedit install,installbin,manpage,po
diff --git a/configure.ac b/configure.ac
index 11d22b9..ae89108 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2926,6 +2926,7 @@ WINE_CONFIG_PROGRAM(notepad,,[install,installbin,manpage,po])
 WINE_CONFIG_PROGRAM(oleview,,[install,po])
 WINE_CONFIG_PROGRAM(ping,,[install])
 WINE_CONFIG_PROGRAM(plugplay,,[install])
+WINE_CONFIG_PROGRAM(presentationfontcache,,[install])
 WINE_CONFIG_PROGRAM(progman,,[install,po])
 WINE_CONFIG_PROGRAM(reg,,[install,po])
 WINE_CONFIG_PROGRAM(regedit,,[install,installbin,manpage,po])
diff --git a/programs/presentationfontcache/Makefile.in b/programs/presentationfontcache/Makefile.in
new file mode 100644
index 0000000..edf8b38
--- /dev/null
+++ b/programs/presentationfontcache/Makefile.in
@@ -0,0 +1,9 @@
+EXTRADEFS = -DWINE_NO_UNICODE_MACROS
+MODULE    = presentationfontcache.exe
+APPMODE   = -mconsole -municode
+IMPORTS   = advapi32
+
+C_SRCS = \
+	main.c
+
+ at MAKE_PROG_RULES@
diff --git a/programs/presentationfontcache/main.c b/programs/presentationfontcache/main.c
new file mode 100644
index 0000000..b17a177
--- /dev/null
+++ b/programs/presentationfontcache/main.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2011 Hans Leidekker for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define WIN32_LEAN_AND_MEAN
+
+#include <windows.h>
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(fontcache);
+
+static WCHAR fontcacheW[] = {'F','o','n','t','C','a','c','h','e','3','.','0','.','0','.','0',0};
+
+static SERVICE_STATUS_HANDLE service_handle;
+static HANDLE stop_event;
+
+static DWORD WINAPI service_handler( DWORD ctrl, DWORD event_type, LPVOID event_data, LPVOID context )
+{
+    SERVICE_STATUS status;
+
+    status.dwServiceType             = SERVICE_WIN32;
+    status.dwControlsAccepted        = SERVICE_ACCEPT_STOP;
+    status.dwWin32ExitCode           = 0;
+    status.dwServiceSpecificExitCode = 0;
+    status.dwCheckPoint              = 0;
+    status.dwWaitHint                = 0;
+
+    switch(ctrl)
+    {
+    case SERVICE_CONTROL_STOP:
+    case SERVICE_CONTROL_SHUTDOWN:
+        WINE_TRACE( "shutting down\n" );
+        status.dwCurrentState     = SERVICE_STOP_PENDING;
+        status.dwControlsAccepted = 0;
+        SetServiceStatus( service_handle, &status );
+        SetEvent( stop_event );
+        return NO_ERROR;
+    default:
+        WINE_FIXME( "got service ctrl %x\n", ctrl );
+        status.dwCurrentState = SERVICE_RUNNING;
+        SetServiceStatus( service_handle, &status );
+        return NO_ERROR;
+    }
+}
+
+static void WINAPI ServiceMain( DWORD argc, LPWSTR *argv )
+{
+    SERVICE_STATUS status;
+
+    WINE_TRACE( "starting service\n" );
+
+    stop_event = CreateEventW( NULL, TRUE, FALSE, NULL );
+
+    service_handle = RegisterServiceCtrlHandlerExW( fontcacheW, service_handler, NULL );
+    if (!service_handle)
+        return;
+
+    status.dwServiceType             = SERVICE_WIN32;
+    status.dwCurrentState            = SERVICE_RUNNING;
+    status.dwControlsAccepted        = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
+    status.dwWin32ExitCode           = 0;
+    status.dwServiceSpecificExitCode = 0;
+    status.dwCheckPoint              = 0;
+    status.dwWaitHint                = 10000;
+    SetServiceStatus( service_handle, &status );
+
+    WaitForSingleObject( stop_event, INFINITE );
+
+    status.dwCurrentState     = SERVICE_STOPPED;
+    status.dwControlsAccepted = 0;
+    SetServiceStatus( service_handle, &status );
+    WINE_TRACE( "service stopped\n" );
+}
+
+int wmain( int argc, WCHAR *argv[] )
+{
+    static const SERVICE_TABLE_ENTRYW service_table[] =
+    {
+        { fontcacheW, ServiceMain },
+        { NULL, NULL }
+    };
+
+    StartServiceCtrlDispatcherW( service_table );
+    return 0;
+}
diff --git a/tools/wine.inf.in b/tools/wine.inf.in
index 77c9d4d..af19c90 100644
--- a/tools/wine.inf.in
+++ b/tools/wine.inf.in
@@ -131,6 +131,7 @@ AddService=Spooler,0,SpoolerService
 AddService=StiSvc,0,StiService
 AddService=TermService,0,TerminalServices
 AddService=PlugPlay,0,PlugPlayService
+AddService=FontCache3.0.0.0,0,FontCacheService
 
 [DefaultInstall.NT.Services]
 AddService=BITS,0,BITSService
@@ -140,6 +141,7 @@ AddService=Spooler,0,SpoolerService
 AddService=StiSvc,0,StiService
 AddService=TermService,0,TerminalServices
 AddService=PlugPlay,0,PlugPlayService
+AddService=FontCache3.0.0.0,0,FontCacheService
 
 [DefaultInstall.ntamd64.Services]
 AddService=BITS,0,BITSService
@@ -149,6 +151,7 @@ AddService=Spooler,0,SpoolerService
 AddService=StiSvc,0,StiService
 AddService=TermService,0,TerminalServices
 AddService=PlugPlay,0,PlugPlayService
+AddService=FontCache3.0.0.0,0,FontCacheService
 
 [Strings]
 MciExtStr="Software\Microsoft\Windows NT\CurrentVersion\MCI Extensions"
@@ -2576,6 +2579,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
 10,Microsoft.NET\Framework\v2.0.50727,ngen.exe
 10,Microsoft.NET\Framework\v2.0.50727,fusion.dll
 10,Microsoft.NET\Framework\v3.0\windows communication foundation,servicemodelreg.exe
+10,Microsoft.NET\Framework\v3.0\wpf,presentationfontcache.exe
 10,Microsoft.NET\Framework\v4.0.30319,ngen.exe
 10,Microsoft.NET\Framework\v4.0.30319,fusion.dll
 11,gecko\plugin,npmshtml.dll
@@ -3028,6 +3032,14 @@ ServiceType=32
 StartType=2
 ErrorControl=1
 
+[FontCacheService]
+Description="Windows Presentation Foundation font cache service"
+DisplayName="Windows Presentation Foundation Font Cache 3.0.0.0"
+ServiceBinary="%10%\Microsoft.Net\Framework\v3.0\wpf\presentationfontcache.exe"
+ServiceType=16
+StartType=3
+ErrorControl=1
+
 [Services]
 HKLM,%CurrentVersion%\RunServices,"winemenubuilder",2,"%11%\winemenubuilder.exe -a -r"
 HKLM,"System\CurrentControlSet\Services\VxD\MSTCP",,16




More information about the wine-cvs mailing list