Pārlūkot izejas kodu

*wince fix: SetErrorMode not exist
+wince : ascfun for Ansi func header

git-svn-id: trunk@3490 -

oro06 19 gadi atpakaļ
vecāks
revīzija
bf6a603d28

+ 1 - 0
.gitattributes

@@ -4615,6 +4615,7 @@ rtl/wince/sysutils.pp -text
 rtl/wince/tthread.inc -text
 rtl/wince/varutils.pp -text
 rtl/wince/windows.pp -text
+rtl/wince/wininc/ascfun.inc svneol=native#text/plain
 rtl/wince/wininc/aygshell.inc -text
 rtl/wince/wininc/base.inc -text
 rtl/wince/wininc/commctrl.inc -text

+ 3 - 3
rtl/objpas/sysutils/sysutils.inc

@@ -586,7 +586,7 @@ function SafeLoadLibrary(const FileName: AnsiString;
     ssecw : DWord;
 {$endif}
   begin
-{$if defined(windows) or defined(win32)}
+{$if defined(win64) or defined(win32)}
     mode:=SetErrorMode(ErrorMode);
 {$endif}
     try
@@ -598,7 +598,7 @@ function SafeLoadLibrary(const FileName: AnsiString;
         ssecw:=GetSSECSR;
 {$endif}
 {$if defined(windows) or defined(win32)}
-      Result:=LoadLibrary(PChar(Filename));
+      Result:=LoadLibraryA(PChar(Filename));
 {$endif}
       finally
 {$if defined(cpui386) or defined(cpux86_64)}
@@ -608,7 +608,7 @@ function SafeLoadLibrary(const FileName: AnsiString;
 {$endif cpui386}
         SetSSECSR(ssecw);
 {$endif}
-{$if defined(windows) or defined(win32)}
+{$if defined(win64) or defined(win32)}
       SetErrorMode(mode);
 {$endif}
     end;

+ 2 - 0
rtl/wince/windows.pp

@@ -46,6 +46,7 @@ interface
 {$i messages.inc}
 {$i unidef.inc}
 {$i func.inc}
+{$i ascfun.inc}
 {$i coredll.inc}
 {$i aygshell.inc}
 {$i commctrl.inc}
@@ -64,6 +65,7 @@ implementation
 {$i messages.inc}
 {$i unidef.inc}
 {$i func.inc}
+{$i ascfun.inc}
 {$i coredll.inc}
 {$i aygshell.inc}
 {$i commctrl.inc}

+ 76 - 0
rtl/wince/wininc/ascfun.inc

@@ -0,0 +1,76 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2000 by the Free Pascal development team.
+
+    Contains the Ascii functions for windows unit
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program 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.
+
+ **********************************************************************}
+{
+  ASCIIFunctions.h
+
+  Declarations for all the Win32 ASCII Functions
+
+  Copyright (C) 1996 Free Software Foundation, Inc.
+
+  Author:  Scott Christley <[email protected]>
+
+  This file is part of the Windows32 API Library.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Library General Public
+  License as published by the Free Software Foundation; either
+  version 2 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
+  Library General Public License for more details.
+
+  If you are interested in a warranty or support for this source code,
+  contact Scott Christley <[email protected]> for more information.
+
+  You should have received a copy of the GNU Library General Public
+  License along with this library; see the file COPYING.LIB.
+  If not, write to the Free Software Foundation,
+  59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+
+  *What should contain this file*
+  
+  Imported functions with header modified in order to be compatible with win32
+  Ansi header equivalent like LoadLibraryA wich not exist under wince.
+  if needed use header definition from rtl\win\wininc\ascfun.inc
+
+  Changes :
+
+  05/13/2006 update for wince4.2 port, [email protected]
+}
+
+{$ifdef read_interface}
+
+function LoadLibraryA(lpLibFileName:LPCSTR):HINST;
+
+{$endif read_interface}
+
+
+{$ifdef read_implementation}
+
+function LoadLibraryA(lpLibFileName:LPCSTR):HINST;
+var  ws: PWideChar;
+begin
+  ws:=StringToPWideChar(lpLibFileName);
+  try
+   Result:=Windows.LoadLibrary(ws);
+  finally FreeMem(ws); end;
+end;
+
+{$endif read_implementation}
+

+ 0 - 2
rtl/wince/wininc/coredll.inc

@@ -769,8 +769,6 @@
       3AB LoadIntChainHandler
       3AD LoadKernelLibrary
       499 LoadKeyboardLayoutW
-      323 LoadLibraryExW
-      322 LoadLibraryW
       4A6 LoadMenuW
       328 LoadResource
       329 LoadStringW

+ 10 - 0
rtl/wince/wininc/unidef.inc

@@ -43,9 +43,17 @@
   If not, write to the Free Software Foundation,
   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
+
+  *What should contain this file*
+
+  Imported functions including xxxW plus default name without the W.
+  it's an union of rtl\win\wininc\unifun.inc and rtl\win\wininc\unidef.inc
+  example: LoadLibraryW an Loadlibrary declaration.
+
   Changes :
 
   08/22/2005 update for wince4.2 port, [email protected]
+  05/13/2006 added some xxxW declarations, remaining a lot !,[email protected]
 }
 
 {$ifdef read_interface}
@@ -162,7 +170,9 @@ function LoadIcon(hInstance:HINST; lpIconName:LPCWSTR):HICON; external UserDLLCo
 function LoadImage(_para1:HINST; _para2:LPCWSTR; _para3:UINT; _para4:longint; _para5:longint;_para6:UINT):HANDLE; external UserDLLCore name 'LoadImageW';
 function LoadKeyboardLayout(pwszKLID:LPCWSTR; Flags:UINT):HKL; external UserDLLCore name 'LoadKeyboardLayoutW';
 function LoadLibrary(lpLibFileName:LPCWSTR):HINST; external KernelDLL name 'LoadLibraryW';
+function LoadLibraryW(lpLibFileName:LPCWSTR):HINST; external KernelDLL name 'LoadLibraryW';
 function LoadLibraryEx(lpLibFileName:LPCWSTR; hFile:HANDLE; dwFlags:DWORD):HINST; external KernelDLL name 'LoadLibraryExW';
+function LoadLibraryExW(lpLibFileName:LPCWSTR; hFile:HANDLE; dwFlags:DWORD):HINST; external KernelDLL name 'LoadLibraryExW';
 function LoadMenu(hInstance:HINST; lpMenuName:LPCWSTR):HMENU; external UserDLLCore name 'LoadMenuW';
 function LoadString(hInstance:HINST; uID:UINT; lpBuffer:LPWSTR; nBufferMax:longint):longint; external UserDLLCore name 'LoadStringW';
 function lstrcmp(lpString1:LPCWSTR; lpString2:LPCWSTR):longint; external KernelDLL name 'lstrcmpW'; //~winbase result is int