From 0a23e1d2c639052393f1b37edd5702c050dda0d7 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Sat, 28 Jan 2012 03:35:20 -0700 Subject: Make Duden Korrektor 5 and 6 work Signed-off-by: Petr Mladek --- sal/systools/win32/uwinapi/legacy.cpp | 46 ++++++++++++++++ sal/systools/win32/uwinapi/makefile.mk | 76 +++------------------------ sal/systools/win32/uwinapi/uwinapi.dxp | 95 ++++++---------------------------- 3 files changed, 69 insertions(+), 148 deletions(-) create mode 100755 sal/systools/win32/uwinapi/legacy.cpp diff --git a/sal/systools/win32/uwinapi/legacy.cpp b/sal/systools/win32/uwinapi/legacy.cpp new file mode 100755 index 000000000..2218d1d77 --- /dev/null +++ b/sal/systools/win32/uwinapi/legacy.cpp @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Fridrich Strba + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#define WIN32_LEAN_AND_MEAN +#include + +#if defined(_MSC_VER) && (_MSC_VER >= 1400) +#pragma warning(disable:4273) // inconsistent dll linkage +#endif + +EXTERN_C DWORD WINAPI GetShortPathNameW(LPCWSTR lpszLongPath,LPWSTR lpszShortPath,DWORD cchBuffer) +{ + typedef DWORD (WINAPI * GetShortPathNameW_t) (LPCWSTR,LPWSTR,DWORD); + + GetShortPathNameW_t p_GetShortPathNameW = + (GetShortPathNameW_t) GetProcAddress ( + GetModuleHandle ("kernel32.dll"), "GetShortPathNameW"); + + if (p_GetShortPathNameW) + return p_GetShortPathNameW(lpszLongPath,lpszShortPath,cchBuffer); + else + return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/systools/win32/uwinapi/makefile.mk b/sal/systools/win32/uwinapi/makefile.mk index 1d7e7580c..7b5c93bd5 100644 --- a/sal/systools/win32/uwinapi/makefile.mk +++ b/sal/systools/win32/uwinapi/makefile.mk @@ -47,69 +47,8 @@ CXXFLAGS+= $(LFS_CFLAGS) CFLAGSCXX+=-Wno-unused-parameter -Wno-return-type .ENDIF -SLOFILES= - -.IF "$(CPU)"=="I" - -SLOFILES+=\ - $(SLO)$/CheckTokenMembership.obj\ - $(SLO)$/CommandLineToArgvW.obj\ - $(SLO)$/CopyFileExA.obj\ - $(SLO)$/CopyFileExW.obj\ - $(SLO)$/DrawStateW.obj\ - $(SLO)$/EnumProcesses.obj\ - $(SLO)$/GetLogicalDriveStringsW.obj\ - $(SLO)$/GetLongPathNameA.obj\ - $(SLO)$/GetLongPathNameW.obj\ - $(SLO)$/GetModuleFileNameExA.obj\ - $(SLO)$/GetModuleFileNameExW.obj\ - $(SLO)$/GetProcessId.obj\ - $(SLO)$/GetUserDefaultUILanguage.obj\ - $(SLO)$/GetUserDomainA.obj\ - $(SLO)$/GetUserDomainW.obj\ - $(SLO)$/GetDiskFreeSpaceExA.obj\ - $(SLO)$/GetDiskFreeSpaceExW.obj\ - $(SLO)$/MoveFileExA.obj\ - $(SLO)$/MoveFileExW.obj\ - $(SLO)$/toolhelp.obj\ - $(SLO)$/DllGetVersion.obj\ - $(SLO)$/DllMain.obj\ - $(SLO)$/ResolveThunk.obj\ - $(SLO)$/ResolveUnicows.obj\ - $(SLO)$/FindFirstVolumeA.obj\ - $(SLO)$/FindFirstVolumeW.obj\ - $(SLO)$/FindNextVolumeA.obj\ - $(SLO)$/FindNextVolumeW.obj\ - $(SLO)$/FindVolumeClose.obj\ - $(SLO)$/FindFirstVolumeMountPointA.obj\ - $(SLO)$/FindFirstVolumeMountPointW.obj\ - $(SLO)$/FindNextVolumeMountPointA.obj\ - $(SLO)$/FindNextVolumeMountPointW.obj\ - $(SLO)$/FindVolumeMountPointClose.obj\ - $(SLO)$/GetVolumeNameForVolumeMountPointA.obj\ - $(SLO)$/GetVolumeNameForVolumeMountPointW.obj\ - $(SLO)$/DeleteVolumeMountPointA.obj\ - $(SLO)$/DeleteVolumeMountPointW.obj\ - $(SLO)$/GetVolumePathNameA.obj\ - $(SLO)$/GetVolumePathNameW.obj\ - $(SLO)$/SetVolumeMountPointA.obj\ - $(SLO)$/SetVolumeMountPointW.obj\ - $(SLO)$/PathAddBackslashW.obj\ - $(SLO)$/PathCompactPathExW.obj\ - $(SLO)$/PathFileExistsW.obj\ - $(SLO)$/PathFindExtensionW.obj\ - $(SLO)$/PathFindFileNameW.obj\ - $(SLO)$/PathIsFileSpecW.obj\ - $(SLO)$/PathIsUNCW.obj\ - $(SLO)$/PathRemoveExtensionW.obj\ - $(SLO)$/PathRemoveFileSpecW.obj\ - $(SLO)$/PathSetDlgItemPathW.obj\ - $(SLO)$/PathStripToRootW.obj\ - $(SLO)$/SHCreateItemFromParsingName.obj - -.ENDIF - -SLOFILES+=\ +SLOFILES=\ + $(SLO)$/legacy.obj\ $(SLO)$/snprintf.obj\ $(SLO)$/snwprintf.obj @@ -117,6 +56,10 @@ SHL1TARGET=$(TARGET) SHL1IMPLIB=$(SHL1TARGET) SHL1DEF=$(MISC)/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) +.IF "$(COM)"=="MSC" +DEF1EXPORTFILE=\ + $(SHL1TARGET).dxp +.ENDIF DEF1DEPN=\ $(DEF1EXPORTFILE)\ makefile.mk @@ -145,11 +88,4 @@ SHL1STDLIBS+=\ .ENDIF -.IF "$(COM)"=="GCC" -ALL: ALLTAR $(LB)$/libuwinapi.a - -$(LB)$/libuwinapi.a: $(MISC)$/uwinapi.def - dlltool --dllname uwinapi.dll --input-def=$(MISC)$/uwinapi.def --kill-at --output-lib=$(LB)$/libuwinapi.a -.ENDIF - .INCLUDE : target.mk diff --git a/sal/systools/win32/uwinapi/uwinapi.dxp b/sal/systools/win32/uwinapi/uwinapi.dxp index 551671853..ff5bc44f3 100644 --- a/sal/systools/win32/uwinapi/uwinapi.dxp +++ b/sal/systools/win32/uwinapi/uwinapi.dxp @@ -1,86 +1,25 @@ -;************************************************************************* -; -; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -; -; Copyright 2000, 2010 Oracle and/or its affiliates. ; -; OpenOffice.org - a multi-platform office productivity suite +; Version: MPL 1.1 / GPLv3+ / LGPLv3+ ; -; This file is part of OpenOffice.org. +; The contents of this file are subject to the Mozilla Public License Version +; 1.1 (the "License"); you may not use this file except in compliance with +; the License or as specified alternatively below. You may obtain a copy of +; the License at http://www.mozilla.org/MPL/ ; -; OpenOffice.org is free software: you can redistribute it and/or modify -; it under the terms of the GNU Lesser General Public License version 3 -; only, as published by the Free Software Foundation. +; Software distributed under the License is distributed on an "AS IS" basis, +; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +; for the specific language governing rights and limitations under the +; License. ; -; OpenOffice.org 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 version 3 for more details -; (a copy is included in the LICENSE file that accompanied this code). +; The Initial Developer of the Original Code is +; Fridrich Strba ; -; You should have received a copy of the GNU Lesser General Public License -; version 3 along with OpenOffice.org. If not, see -; -; for a copy of the LGPLv3 License. +; Alternatively, the contents of this file may be used under the terms of +; either the GNU General Public License Version 3 or later (the "GPLv3+"), or +; the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +; in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +; instead of those above. ; ;************************************************************************* -DllGetVersion -;CheckTokenMembership -CommandLineToArgvW -CopyFileExA -CopyFileExW -CreateToolhelp32Snapshot -DrawStateW -EnumProcesses -GetDiskFreeSpaceExA -GetDiskFreeSpaceExW -GetLogicalDriveStringsW -GetLongPathNameA -GetLongPathNameW -GetModuleFileNameExA -GetModuleFileNameExW -GetProcessId -GetUserDefaultUILanguage -GetUserDomainA -GetUserDomainW -Module32First -Module32FirstW -Module32Next -Module32NextW -MoveFileExA -MoveFileExW -Process32First -Process32FirstW -Process32Next -Process32NextW -FindFirstVolumeA -FindFirstVolumeW -FindNextVolumeA -FindNextVolumeW -FindVolumeClose -FindFirstVolumeMountPointA -FindFirstVolumeMountPointW -FindNextVolumeMountPointA -FindNextVolumeMountPointW -FindVolumeMountPointClose -GetVolumeNameForVolumeMountPointA -GetVolumeNameForVolumeMountPointW -DeleteVolumeMountPointA -DeleteVolumeMountPointW -GetVolumePathNameA -GetVolumePathNameW -SetVolumeMountPointA -SetVolumeMountPointW -PathAddBackslashW -PathCompactPathExW -PathFileExistsW -PathFindExtensionW -PathFindFileNameW -PathIsFileSpecW -PathIsUNCW -PathRemoveExtensionW -PathRemoveFileSpecW -PathSetDlgItemPathW -PathStripToRootW -SHCreateItemFromParsingName +GetShortPathNameW PRIVATE -- cgit v1.2.3