- Timestamp:
- Sep 5, 2001, 2:58:00 PM (24 years ago)
- Location:
- trunk/src
- Files:
-
- 17 edited
-
DPlayX/initterm.cpp (modified) (2 diffs)
-
ddraw/initterm.cpp (modified) (5 diffs)
-
ddraw/os2fsdd.cpp (modified) (1 diff)
-
driverdll/testdrv.cpp (modified) (6 diffs)
-
dsound/initterm.cpp (modified) (1 diff)
-
gdi32/initgdi32.cpp (modified) (5 diffs)
-
gdi32/initterm.cpp (modified) (2 diffs)
-
imagehlp/initterm.cpp (modified) (3 diffs)
-
kernel32/codepage.cpp (modified) (5 diffs)
-
kernel32/hmmailslot.cpp (modified) (6 diffs)
-
kernel32/initkernel32.cpp (modified) (2 diffs)
-
kernel32/initterm.cpp (modified) (3 diffs)
-
kernel32/mailslot.cpp (modified) (5 diffs)
-
kernel32/module.cpp (modified) (10 diffs)
-
kernel32/ole2nls.cpp (modified) (140 diffs)
-
kernel32/ordinals.cpp (modified) (5 diffs)
-
kernel32/stubs.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/DPlayX/initterm.cpp
r5135 r6646 1 /* 1 /* $Id: initterm.cpp,v 1.7 2001-09-05 12:51:21 bird Exp $ 2 * 2 3 * DLL entry point 3 4 * … … 69 70 70 71 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 71 72 72 73 dllHandle = RegisterLxDll(hModule, DPLAYX_LibMain, (PVOID)&_Resource_PEResTab); 73 74 if(dllHandle == 0) -
trunk/src/ddraw/initterm.cpp
r5326 r6646 1 /* 1 /* $Id: initterm.cpp,v 1.19 2001-09-05 12:50:39 bird Exp $ 2 * 2 3 * DLL entry point 3 4 * … … 91 92 case 0 : 92 93 { 93 APIRET rc;94 94 APIRET rc; 95 95 96 #ifdef __IBMCPP__ 96 97 ctordtorInit(); … … 99 100 char *endofpath = strrchr(ddrawPath, '\\'); 100 101 if (endofpath) 101 *(endofpath+1) = '\0';102 *(endofpath+1) = '\0'; 102 103 103 104 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ … … 107 108 IMAGE_SUBSYSTEM_WINDOWS_GUI); 108 109 if (dllHandle == 0) 109 return 0UL;110 return 0UL; 110 111 111 112 rc = DosExitList(EXITLIST_NONCOREDLL | EXLST_ADD, cleanup); 112 113 if (rc) 113 return 0UL;114 return 0UL; 114 115 115 116 break; … … 117 118 case 1 : 118 119 if(dllHandle) { 119 UnregisterLxDll(dllHandle);120 UnregisterLxDll(dllHandle); 120 121 } 121 122 break; -
trunk/src/ddraw/os2fsdd.cpp
r5330 r6646 1 /* 1 /* $Id: os2fsdd.cpp,v 1.2 2001-09-05 12:50:39 bird Exp $ 2 * 2 3 * Few routines for full-screen DirectDraw on OS/2 3 4 * -
trunk/src/driverdll/testdrv.cpp
r6457 r6646 1 /* $Id: testdrv.cpp,v 1.3 2001-09-05 12:52:27 bird Exp $ */ 1 2 //****************************************************************************** 2 3 //****************************************************************************** … … 16 17 #define INCL_DOSPROCESS /* DOS Process values */ 17 18 #define INCL_DOSMISC /* DOS Miscellanous values */ 18 #include <os2wrap.h> //Odin32 OS/2 api wrappers19 #include <os2wrap.h> //Odin32 OS/2 api wrappers 19 20 20 21 #include <winconst.h> … … 24 25 #include <win\winioctl.h> 25 26 26 #define TESTDRV_CATEGORY 0x4027 #define TESTDRV_CATEGORY 0x40 27 28 28 29 //****************************************************************************** … … 54 55 55 56 tryopen: 56 rc = DosOpen( "TESTDRV$", /* File path name */57 &hfFileHandle, /* File handle */58 &ulAction, /* Action taken */59 0,60 FILE_NORMAL,61 FILE_OPEN,62 sharetype,63 0L); /* No extended attribute */57 rc = DosOpen( "TESTDRV$", /* File path name */ 58 &hfFileHandle, /* File handle */ 59 &ulAction, /* Action taken */ 60 0, 61 FILE_NORMAL, 62 FILE_OPEN, 63 sharetype, 64 0L); /* No extended attribute */ 64 65 65 66 if(rc == ERROR_TOO_MANY_OPEN_FILES) { … … 67 68 LONG ReqCount = 32; 68 69 69 rc = DosSetRelMaxFH(&ReqCount, &CurMaxFH);70 if(rc) {71 dprintf(("DosSetRelMaxFH returned %d", rc));72 return rc;73 }74 dprintf(("DosOpen failed -> increased nr open files to %d", CurMaxFH));75 goto tryopen;70 rc = DosSetRelMaxFH(&ReqCount, &CurMaxFH); 71 if(rc) { 72 dprintf(("DosSetRelMaxFH returned %d", rc)); 73 return rc; 74 } 75 dprintf(("DosOpen failed -> increased nr open files to %d", CurMaxFH)); 76 goto tryopen; 76 77 } 77 78 78 79 if(rc == NO_ERROR) { 79 return hfFileHandle;80 return hfFileHandle; 80 81 } 81 82 else return -1; … … 105 106 *lpBytesReturned = nOutBufferSize; 106 107 107 rc = DosDevIOCtl(hDevice, TESTDRV_CATEGORY, ioctl, 108 rc = DosDevIOCtl(hDevice, TESTDRV_CATEGORY, ioctl, 108 109 lpInBuffer, nInBufferSize, &nInBufferSize, 109 110 lpOutBuffer, nOutBufferSize, lpBytesReturned); -
trunk/src/dsound/initterm.cpp
r5305 r6646 1 /* 1 /* $Id: initterm.cpp,v 1.17 2001-09-05 12:53:02 bird Exp $ 2 * 2 3 * DLL entry point 3 4 * -
trunk/src/gdi32/initgdi32.cpp
r6467 r6646 1 /* 1 /* $Id: initgdi32.cpp,v 1.5 2001-09-05 12:53:52 bird Exp $ 2 * 2 3 * DLL entry point 3 4 * … … 34 35 #include <odinlx.h> 35 36 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ 36 #define DBG_LOCALLOG DBG_initterm37 #define DBG_LOCALLOG DBG_initterm 37 38 #include "dbglocal.h" 38 39 #include "region.h" … … 51 52 { 52 53 case DLL_PROCESS_ATTACH: 53 return TRUE;54 return TRUE; 54 55 55 56 case DLL_THREAD_ATTACH: 56 57 case DLL_THREAD_DETACH: 57 return TRUE;58 return TRUE; 58 59 59 60 case DLL_PROCESS_DETACH: 60 ctordtorTerm();61 return TRUE;61 ctordtorTerm(); 62 return TRUE; 62 63 } 63 64 return FALSE; … … 88 89 InitializeKernel32(); 89 90 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 90 if(InitRegionSpace() == FALSE) {91 return 0UL;91 if(InitRegionSpace() == FALSE) { 92 return 0UL; 92 93 } 93 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&gdi32_PEResTab,94 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&gdi32_PEResTab, 94 95 GDI32_MAJORIMAGE_VERSION, GDI32_MINORIMAGE_VERSION, 95 96 IMAGE_SUBSYSTEM_NATIVE); 96 if(dllHandle == 0) 97 return 0UL;97 if(dllHandle == 0) 98 return 0UL; 98 99 99 100 dprintf(("gdi32 init %s %s (%x)", __DATE__, __TIME__, inittermGdi32)); … … 102 103 case 1 : 103 104 if(dllHandle) { 104 UnregisterLxDll(dllHandle);105 UnregisterLxDll(dllHandle); 105 106 } 106 107 break; -
trunk/src/gdi32/initterm.cpp
r6467 r6646 1 /* 1 /* $Id: initterm.cpp,v 1.20 2001-09-05 12:53:52 bird Exp $ 2 * 2 3 * DLL entry point 3 4 * … … 34 35 #include <odinlx.h> 35 36 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ 36 #define DBG_LOCALLOG DBG_initterm37 #define DBG_LOCALLOG DBG_initterm 37 38 #include "dbglocal.h" 38 39 #include "region.h" -
trunk/src/imagehlp/initterm.cpp
r5135 r6646 1 /* 1 /* $Id: initterm.cpp,v 1.7 2001-09-05 12:55:49 bird Exp $ 2 * 2 3 * DLL entry point 3 4 * … … 53 54 case DLL_THREAD_ATTACH: 54 55 case DLL_THREAD_DETACH: 55 return IMAGEHLP_LibMain(hinstDLL, fdwReason, fImpLoad);56 return IMAGEHLP_LibMain(hinstDLL, fdwReason, fImpLoad); 56 57 57 58 case DLL_PROCESS_DETACH: 58 IMAGEHLP_LibMain(hinstDLL, fdwReason, fImpLoad);59 ctordtorTerm();60 return TRUE;59 IMAGEHLP_LibMain(hinstDLL, fdwReason, fImpLoad); 60 ctordtorTerm(); 61 return TRUE; 61 62 } 62 63 return FALSE; … … 88 89 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 89 90 90 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab);91 if(dllHandle == 0) 92 return 0UL;91 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab); 92 if(dllHandle == 0) 93 return 0UL; 93 94 94 95 break; 95 96 case 1 : 96 97 if(dllHandle) { 97 UnregisterLxDll(dllHandle);98 UnregisterLxDll(dllHandle); 98 99 } 99 100 break; -
trunk/src/kernel32/codepage.cpp
r5764 r6646 1 /* 1 /* $Id: codepage.cpp,v 1.17 2001-09-05 12:57:58 bird Exp $ 2 * 2 3 * Code page functions 3 4 * 4 5 * Based on Wine code (memory\codepage.c) 5 * 6 * 6 7 * Copyright 2000 Alexandre Julliard 7 8 * … … 25 26 #include "codepage.h" 26 27 27 #define DBG_LOCALLOG DBG_codepage28 #define DBG_LOCALLOG DBG_codepage 28 29 #include "dbglocal.h" 29 30 #endif … … 92 93 93 94 if (!ansi_cptable) init_codepages(); /* just in case */ 94 95 95 96 if ((table = get_locale_cp( lcid, LOCALE_IDEFAULTANSICODEPAGE ))) ansi_cptable = table; 96 97 if ((table = get_locale_cp( lcid, LOCALE_IDEFAULTMACCODEPAGE ))) mac_cptable = table; … … 197 198 #endif 198 199 199 if (!table) 200 if (!table) 200 201 { 201 202 SetLastError( ERROR_INVALID_PARAMETER ); … … 366 367 * dstlen [in] Length of destination buffer 367 368 * defchar [in] Default character to use for conversion if no exact 368 * conversion can be made369 * conversion can be made 369 370 * used [out] Set if default character was used in the conversion 370 371 * -
trunk/src/kernel32/hmmailslot.cpp
r5587 r6646 1 /* 1 /* $Id: hmmailslot.cpp,v 1.2 2001-09-05 12:57:58 bird Exp $ 2 * 2 3 * Win32 mailslot APIs 3 4 * … … 22 23 #include "dbglocal.h" 23 24 24 HMMailSlotInfo::HMMailSlotInfo(LPCSTR lpszName, HANDLE hPipe, DWORD nMaxMessageSize, 25 HMMailSlotInfo::HMMailSlotInfo(LPCSTR lpszName, HANDLE hPipe, DWORD nMaxMessageSize, 25 26 DWORD lReadTimeout, BOOL fServer, 26 27 LPSECURITY_ATTRIBUTES lpSecurityAttributes) … … 129 130 strcat(pipename, lpName); 130 131 //TODO: lookup name and fail if exists 131 hPipe = CreateNamedPipeA(pipename, PIPE_ACCESS_INBOUND, 132 PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_NOWAIT, 133 PIPE_UNLIMITED_INSTANCES, MAILSLOT_SIZE, 134 (nMaxMessageSize) ? nMaxMessageSize : MAILSLOT_SIZE, 132 hPipe = CreateNamedPipeA(pipename, PIPE_ACCESS_INBOUND, 133 PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_NOWAIT, 134 PIPE_UNLIMITED_INSTANCES, MAILSLOT_SIZE, 135 (nMaxMessageSize) ? nMaxMessageSize : MAILSLOT_SIZE, 135 136 lReadTimeout, lpSecurityAttributes); 136 137 137 if(hPipe == INVALID_HANDLE_VALUE) { 138 if(hPipe == INVALID_HANDLE_VALUE) { 138 139 dprintf(("CreateMailslotA: unable to create pipe %s", pipename)); 139 140 return FALSE; … … 146 147 } 147 148 else 148 if(lReadTimeout != 0) { 149 if(lReadTimeout != 0) { 149 150 dprintf(("WARNING: timeout %x not supported", lReadTimeout)); 150 151 } … … 168 169 * Variables : 169 170 * Result : 170 * Remark : 171 * Remark : 171 172 * Status : NO_ERROR - API succeeded 172 173 * other - what is to be set in SetLastError … … 202 203 pHMHandleData->dwFlags, 0); 203 204 204 if(hPipe == INVALID_HANDLE_VALUE) { 205 if(hPipe == INVALID_HANDLE_VALUE) { 205 206 if(pipename[11] == '*') { 206 207 dprintf(("pipename with asterix not supported; connect only to one mailslot")); -
trunk/src/kernel32/initkernel32.cpp
r6468 r6646 1 /* 1 /* $Id: initkernel32.cpp,v 1.7 2001-09-05 12:57:58 bird Exp $ 2 * 2 3 * KERNEL32 DLL entry point 3 4 * … … 84 85 APIRET rc; 85 86 ULONG ulSysinfo, version[2]; 86 87 87 88 /*-------------------------------------------------------------------------*/ 88 89 /* If ulFlag is zero then the DLL is being loaded so initialization should */ -
trunk/src/kernel32/initterm.cpp
r6468 r6646 1 /* 1 /* $Id: initterm.cpp,v 1.63 2001-09-05 12:57:58 bird Exp $ 2 * 2 3 * KERNEL32 DLL entry point 3 4 * … … 88 89 APIRET rc; 89 90 ULONG ulSysinfo, version[2]; 90 91 91 92 /*-------------------------------------------------------------------------*/ 92 93 /* If ulFlag is zero then the DLL is being loaded so initialization should */ … … 122 123 } 123 124 } 124 125 125 126 rc = inittermKernel32(hModule, ulFlag); 126 127 break; -
trunk/src/kernel32/mailslot.cpp
r5587 r6646 1 /* 1 /* $Id: mailslot.cpp,v 1.2 2001-09-05 12:57:59 bird Exp $ 2 * 2 3 * Win32 mailslot APIs 3 4 * … … 37 38 * If the function fails, the return value is INVALID_HANDLE_VALUE. 38 39 * Remark : 39 * Status : 40 * Status : 40 41 * 41 42 * Author : SvL … … 66 67 * If the function fails, the return value is INVALID_HANDLE_VALUE. 67 68 * Remark : 68 * Status : 69 * Status : 69 70 * 70 71 * Author : SvL … … 96 97 * Result : TRUE / FALSE 97 98 * Remark : 98 * Status : 99 * Status : 99 100 * 100 101 * Author : SvL … … 120 121 * Result : TRUE / FALSE 121 122 * Remark : 122 * Status : 123 * Status : 123 124 * 124 125 * Author : SvL -
trunk/src/kernel32/module.cpp
r5587 r6646 1 /* 1 /* $Id: module.cpp,v 1.3 2001-09-05 12:57:59 bird Exp $ 2 * 2 3 * GetBinaryTypeA/W (Wine Port) 3 4 * … … 13 14 #include <misc.h> 14 15 15 #define DBG_LOCALLOG DBG_module16 #define DBG_LOCALLOG DBG_module 16 17 #include "dbglocal.h" 17 18 … … 38 39 || (!(ReadFile(hfile, modtab, ne->ne_cmod*sizeof(WORD), &len, NULL))) 39 40 || (len != ne->ne_cmod*sizeof(WORD)) ) 40 goto broken;41 goto broken; 41 42 42 43 /* read imported names table */ … … 45 46 || (!(ReadFile(hfile, nametab, ne->ne_enttab - ne->ne_imptab, &len, NULL))) 46 47 || (len != ne->ne_enttab - ne->ne_imptab) ) 47 goto broken;48 goto broken; 48 49 49 50 for (i=0; i < ne->ne_cmod; i++) 50 51 { 51 LPSTR module = &nametab[modtab[i]];52 TRACE("modref: %.*s\n", module[0], &module[1]);53 if (!(strncmp(&module[1], "KERNEL", module[0])))54 { /* very old Windows file */55 MESSAGE("This seems to be a very old (pre-3.0) Windows executable. Expect crashes, especially if this is a real-mode binary !\n");56 type = SCS_WOW_BINARY;57 goto good;58 }52 LPSTR module = &nametab[modtab[i]]; 53 TRACE("modref: %.*s\n", module[0], &module[1]); 54 if (!(strncmp(&module[1], "KERNEL", module[0]))) 55 { /* very old Windows file */ 56 MESSAGE("This seems to be a very old (pre-3.0) Windows executable. Expect crashes, especially if this is a real-mode binary !\n"); 57 type = SCS_WOW_BINARY; 58 goto good; 59 } 59 60 } 60 61 … … 107 108 /* Seek to the start of the file and read the DOS header information. 108 109 */ 109 if ( SetFilePointer( hfile, 0, NULL, SEEK_SET ) != -1 110 if ( SetFilePointer( hfile, 0, NULL, SEEK_SET ) != -1 110 111 && ReadFile( hfile, &mz_header, sizeof(mz_header), &len, NULL ) 111 112 && len == sizeof(mz_header) ) … … 132 133 ( mz_header.e_lfarlc >= sizeof(IMAGE_DOS_HEADER) ) ) 133 134 if ( mz_header.e_lfanew >= sizeof(IMAGE_DOS_HEADER) 134 && SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ) != -1 135 && SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ) != -1 135 136 && ReadFile( hfile, magic, sizeof(magic), &len, NULL ) 136 137 && len == sizeof(magic) ) … … 162 163 * "extended header is a Windows executable (NE) 163 164 * header." This can mean either a 16-bit OS/2 164 * or a 16-bit Windows or even a DOS program 165 * or a 16-bit Windows or even a DOS program 165 166 * (running under a DOS extender). To decide 166 167 * which, we'll have to read the NE header. … … 168 169 169 170 IMAGE_OS2_HEADER ne; 170 if ( SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ) != -1 171 if ( SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ) != -1 171 172 && ReadFile( hfile, &ne, sizeof(ne), &len, NULL ) 172 173 && len == sizeof(ne) ) … … 177 178 case 5: *lpBinaryType = SCS_DOS_BINARY; return TRUE; 178 179 default: *lpBinaryType = 179 MODULE_Decide_OS2_OldWin(hfile, &mz_header, &ne);180 return TRUE;180 MODULE_Decide_OS2_OldWin(hfile, &mz_header, &ne); 181 return TRUE; 181 182 } 182 183 } … … 187 188 { 188 189 /* Unknown extended header, but this file is nonetheless 189 DOS-executable.190 DOS-executable. 190 191 */ 191 192 *lpBinaryType = SCS_DOS_BINARY; 192 return TRUE;193 return TRUE; 193 194 } 194 195 } -
trunk/src/kernel32/ole2nls.cpp
r6607 r6646 1 /* 2 * National Language Support library 1 /* $Id: ole2nls.cpp,v 1.14 2001-09-05 12:57:59 bird Exp $ 3 2 * 4 * Copyright 1995 Martin von Loewis 3 * National Language Support library 4 * 5 * Copyright 1995 Martin von Loewis 5 6 * Copyright 1998 David Lee Lambert 6 7 * Copyright 2000 Julio César Gázquez … … 41 42 #include <unicode.h> 42 43 43 #define DBG_LOCALLOG DBG_kernel3244 #define DBG_LOCALLOG DBG_kernel32 44 45 #include "dbglocal.h" 45 46 … … 49 50 DEFAULT_DEBUG_CHANNEL(string); 50 51 51 /* Locale name to id map. used by EnumSystemLocales, GetLocaleInfoA 52 /* Locale name to id map. used by EnumSystemLocales, GetLocaleInfoA 52 53 * MUST contain all #defines from winnls.h 53 54 * last entry has NULL name, 0 id. 54 */ 55 #define LOCALE_ENTRY(x) {#x,LOCALE_##x}55 */ 56 #define LOCALE_ENTRY(x) {#x,LOCALE_##x} 56 57 static const struct tagLOCALE_NAME2ID { 57 const char *name;58 LCTYPE id;58 const char *name; 59 LCTYPE id; 59 60 } locale_name2id[]= { 60 LOCALE_ENTRY(ILANGUAGE),61 LOCALE_ENTRY(SLANGUAGE),62 LOCALE_ENTRY(SENGLANGUAGE),63 LOCALE_ENTRY(SABBREVLANGNAME),64 LOCALE_ENTRY(SNATIVELANGNAME),65 LOCALE_ENTRY(ICOUNTRY),66 LOCALE_ENTRY(SCOUNTRY),67 LOCALE_ENTRY(SENGCOUNTRY),68 LOCALE_ENTRY(SABBREVCTRYNAME),69 LOCALE_ENTRY(SNATIVECTRYNAME),70 LOCALE_ENTRY(IDEFAULTLANGUAGE),71 LOCALE_ENTRY(IDEFAULTCOUNTRY),72 LOCALE_ENTRY(IDEFAULTCODEPAGE),73 LOCALE_ENTRY(IDEFAULTANSICODEPAGE),74 LOCALE_ENTRY(IDEFAULTMACCODEPAGE),75 LOCALE_ENTRY(SLIST),76 LOCALE_ENTRY(IMEASURE),77 LOCALE_ENTRY(SDECIMAL),78 LOCALE_ENTRY(STHOUSAND),79 LOCALE_ENTRY(SGROUPING),80 LOCALE_ENTRY(IDIGITS),81 LOCALE_ENTRY(ILZERO),82 LOCALE_ENTRY(INEGNUMBER),83 LOCALE_ENTRY(SNATIVEDIGITS),84 LOCALE_ENTRY(SCURRENCY),85 LOCALE_ENTRY(SINTLSYMBOL),86 LOCALE_ENTRY(SMONDECIMALSEP),87 LOCALE_ENTRY(SMONTHOUSANDSEP),88 LOCALE_ENTRY(SMONGROUPING),89 LOCALE_ENTRY(ICURRDIGITS),90 LOCALE_ENTRY(IINTLCURRDIGITS),91 LOCALE_ENTRY(ICURRENCY),92 LOCALE_ENTRY(INEGCURR),93 LOCALE_ENTRY(SDATE),94 LOCALE_ENTRY(STIME),95 LOCALE_ENTRY(SSHORTDATE),96 LOCALE_ENTRY(SLONGDATE),97 LOCALE_ENTRY(STIMEFORMAT),98 LOCALE_ENTRY(IDATE),99 LOCALE_ENTRY(ILDATE),100 LOCALE_ENTRY(ITIME),101 LOCALE_ENTRY(ITIMEMARKPOSN),102 LOCALE_ENTRY(ICENTURY),103 LOCALE_ENTRY(ITLZERO),104 LOCALE_ENTRY(IDAYLZERO),105 LOCALE_ENTRY(IMONLZERO),106 LOCALE_ENTRY(S1159),107 LOCALE_ENTRY(S2359),108 LOCALE_ENTRY(ICALENDARTYPE),109 LOCALE_ENTRY(IOPTIONALCALENDAR),110 LOCALE_ENTRY(IFIRSTDAYOFWEEK),111 LOCALE_ENTRY(IFIRSTWEEKOFYEAR),112 LOCALE_ENTRY(SDAYNAME1),113 LOCALE_ENTRY(SDAYNAME2),114 LOCALE_ENTRY(SDAYNAME3),115 LOCALE_ENTRY(SDAYNAME4),116 LOCALE_ENTRY(SDAYNAME5),117 LOCALE_ENTRY(SDAYNAME6),118 LOCALE_ENTRY(SDAYNAME7),119 LOCALE_ENTRY(SABBREVDAYNAME1),120 LOCALE_ENTRY(SABBREVDAYNAME2),121 LOCALE_ENTRY(SABBREVDAYNAME3),122 LOCALE_ENTRY(SABBREVDAYNAME4),123 LOCALE_ENTRY(SABBREVDAYNAME5),124 LOCALE_ENTRY(SABBREVDAYNAME6),125 LOCALE_ENTRY(SABBREVDAYNAME7),126 LOCALE_ENTRY(SMONTHNAME1),127 LOCALE_ENTRY(SMONTHNAME2),128 LOCALE_ENTRY(SMONTHNAME3),129 LOCALE_ENTRY(SMONTHNAME4),130 LOCALE_ENTRY(SMONTHNAME5),131 LOCALE_ENTRY(SMONTHNAME6),132 LOCALE_ENTRY(SMONTHNAME7),133 LOCALE_ENTRY(SMONTHNAME8),134 LOCALE_ENTRY(SMONTHNAME9),135 LOCALE_ENTRY(SMONTHNAME10),136 LOCALE_ENTRY(SMONTHNAME11),137 LOCALE_ENTRY(SMONTHNAME12),138 LOCALE_ENTRY(SMONTHNAME13),139 LOCALE_ENTRY(SABBREVMONTHNAME1),140 LOCALE_ENTRY(SABBREVMONTHNAME2),141 LOCALE_ENTRY(SABBREVMONTHNAME3),142 LOCALE_ENTRY(SABBREVMONTHNAME4),143 LOCALE_ENTRY(SABBREVMONTHNAME5),144 LOCALE_ENTRY(SABBREVMONTHNAME6),145 LOCALE_ENTRY(SABBREVMONTHNAME7),146 LOCALE_ENTRY(SABBREVMONTHNAME8),147 LOCALE_ENTRY(SABBREVMONTHNAME9),148 LOCALE_ENTRY(SABBREVMONTHNAME10),149 LOCALE_ENTRY(SABBREVMONTHNAME11),150 LOCALE_ENTRY(SABBREVMONTHNAME12),151 LOCALE_ENTRY(SABBREVMONTHNAME13),152 LOCALE_ENTRY(SPOSITIVESIGN),153 LOCALE_ENTRY(SNEGATIVESIGN),154 LOCALE_ENTRY(IPOSSIGNPOSN),155 LOCALE_ENTRY(INEGSIGNPOSN),156 LOCALE_ENTRY(IPOSSYMPRECEDES),157 LOCALE_ENTRY(IPOSSEPBYSPACE),158 LOCALE_ENTRY(INEGSYMPRECEDES),159 LOCALE_ENTRY(INEGSEPBYSPACE),160 LOCALE_ENTRY(FONTSIGNATURE),161 LOCALE_ENTRY(SISO639LANGNAME),162 LOCALE_ENTRY(SISO3166CTRYNAME),163 {NULL,0}61 LOCALE_ENTRY(ILANGUAGE), 62 LOCALE_ENTRY(SLANGUAGE), 63 LOCALE_ENTRY(SENGLANGUAGE), 64 LOCALE_ENTRY(SABBREVLANGNAME), 65 LOCALE_ENTRY(SNATIVELANGNAME), 66 LOCALE_ENTRY(ICOUNTRY), 67 LOCALE_ENTRY(SCOUNTRY), 68 LOCALE_ENTRY(SENGCOUNTRY), 69 LOCALE_ENTRY(SABBREVCTRYNAME), 70 LOCALE_ENTRY(SNATIVECTRYNAME), 71 LOCALE_ENTRY(IDEFAULTLANGUAGE), 72 LOCALE_ENTRY(IDEFAULTCOUNTRY), 73 LOCALE_ENTRY(IDEFAULTCODEPAGE), 74 LOCALE_ENTRY(IDEFAULTANSICODEPAGE), 75 LOCALE_ENTRY(IDEFAULTMACCODEPAGE), 76 LOCALE_ENTRY(SLIST), 77 LOCALE_ENTRY(IMEASURE), 78 LOCALE_ENTRY(SDECIMAL), 79 LOCALE_ENTRY(STHOUSAND), 80 LOCALE_ENTRY(SGROUPING), 81 LOCALE_ENTRY(IDIGITS), 82 LOCALE_ENTRY(ILZERO), 83 LOCALE_ENTRY(INEGNUMBER), 84 LOCALE_ENTRY(SNATIVEDIGITS), 85 LOCALE_ENTRY(SCURRENCY), 86 LOCALE_ENTRY(SINTLSYMBOL), 87 LOCALE_ENTRY(SMONDECIMALSEP), 88 LOCALE_ENTRY(SMONTHOUSANDSEP), 89 LOCALE_ENTRY(SMONGROUPING), 90 LOCALE_ENTRY(ICURRDIGITS), 91 LOCALE_ENTRY(IINTLCURRDIGITS), 92 LOCALE_ENTRY(ICURRENCY), 93 LOCALE_ENTRY(INEGCURR), 94 LOCALE_ENTRY(SDATE), 95 LOCALE_ENTRY(STIME), 96 LOCALE_ENTRY(SSHORTDATE), 97 LOCALE_ENTRY(SLONGDATE), 98 LOCALE_ENTRY(STIMEFORMAT), 99 LOCALE_ENTRY(IDATE), 100 LOCALE_ENTRY(ILDATE), 101 LOCALE_ENTRY(ITIME), 102 LOCALE_ENTRY(ITIMEMARKPOSN), 103 LOCALE_ENTRY(ICENTURY), 104 LOCALE_ENTRY(ITLZERO), 105 LOCALE_ENTRY(IDAYLZERO), 106 LOCALE_ENTRY(IMONLZERO), 107 LOCALE_ENTRY(S1159), 108 LOCALE_ENTRY(S2359), 109 LOCALE_ENTRY(ICALENDARTYPE), 110 LOCALE_ENTRY(IOPTIONALCALENDAR), 111 LOCALE_ENTRY(IFIRSTDAYOFWEEK), 112 LOCALE_ENTRY(IFIRSTWEEKOFYEAR), 113 LOCALE_ENTRY(SDAYNAME1), 114 LOCALE_ENTRY(SDAYNAME2), 115 LOCALE_ENTRY(SDAYNAME3), 116 LOCALE_ENTRY(SDAYNAME4), 117 LOCALE_ENTRY(SDAYNAME5), 118 LOCALE_ENTRY(SDAYNAME6), 119 LOCALE_ENTRY(SDAYNAME7), 120 LOCALE_ENTRY(SABBREVDAYNAME1), 121 LOCALE_ENTRY(SABBREVDAYNAME2), 122 LOCALE_ENTRY(SABBREVDAYNAME3), 123 LOCALE_ENTRY(SABBREVDAYNAME4), 124 LOCALE_ENTRY(SABBREVDAYNAME5), 125 LOCALE_ENTRY(SABBREVDAYNAME6), 126 LOCALE_ENTRY(SABBREVDAYNAME7), 127 LOCALE_ENTRY(SMONTHNAME1), 128 LOCALE_ENTRY(SMONTHNAME2), 129 LOCALE_ENTRY(SMONTHNAME3), 130 LOCALE_ENTRY(SMONTHNAME4), 131 LOCALE_ENTRY(SMONTHNAME5), 132 LOCALE_ENTRY(SMONTHNAME6), 133 LOCALE_ENTRY(SMONTHNAME7), 134 LOCALE_ENTRY(SMONTHNAME8), 135 LOCALE_ENTRY(SMONTHNAME9), 136 LOCALE_ENTRY(SMONTHNAME10), 137 LOCALE_ENTRY(SMONTHNAME11), 138 LOCALE_ENTRY(SMONTHNAME12), 139 LOCALE_ENTRY(SMONTHNAME13), 140 LOCALE_ENTRY(SABBREVMONTHNAME1), 141 LOCALE_ENTRY(SABBREVMONTHNAME2), 142 LOCALE_ENTRY(SABBREVMONTHNAME3), 143 LOCALE_ENTRY(SABBREVMONTHNAME4), 144 LOCALE_ENTRY(SABBREVMONTHNAME5), 145 LOCALE_ENTRY(SABBREVMONTHNAME6), 146 LOCALE_ENTRY(SABBREVMONTHNAME7), 147 LOCALE_ENTRY(SABBREVMONTHNAME8), 148 LOCALE_ENTRY(SABBREVMONTHNAME9), 149 LOCALE_ENTRY(SABBREVMONTHNAME10), 150 LOCALE_ENTRY(SABBREVMONTHNAME11), 151 LOCALE_ENTRY(SABBREVMONTHNAME12), 152 LOCALE_ENTRY(SABBREVMONTHNAME13), 153 LOCALE_ENTRY(SPOSITIVESIGN), 154 LOCALE_ENTRY(SNEGATIVESIGN), 155 LOCALE_ENTRY(IPOSSIGNPOSN), 156 LOCALE_ENTRY(INEGSIGNPOSN), 157 LOCALE_ENTRY(IPOSSYMPRECEDES), 158 LOCALE_ENTRY(IPOSSEPBYSPACE), 159 LOCALE_ENTRY(INEGSYMPRECEDES), 160 LOCALE_ENTRY(INEGSEPBYSPACE), 161 LOCALE_ENTRY(FONTSIGNATURE), 162 LOCALE_ENTRY(SISO639LANGNAME), 163 LOCALE_ENTRY(SISO3166CTRYNAME), 164 {NULL,0} 164 165 }; 165 166 … … 168 169 #ifndef __WIN32OS2__ 169 170 /*********************************************************************** 170 * GetUserDefaultLCID (KERNEL32.@)171 * GetUserDefaultLCID (OLE2NLS.1)171 * GetUserDefaultLCID (KERNEL32.@) 172 * GetUserDefaultLCID (OLE2NLS.1) 172 173 */ 173 174 LCID WINAPI GetUserDefaultLCID(void) 174 175 { 175 return MAKELCID( GetUserDefaultLangID() , SORT_DEFAULT );176 return MAKELCID( GetUserDefaultLangID() , SORT_DEFAULT ); 176 177 } 177 178 178 179 /*********************************************************************** 179 * GetSystemDefaultLCID (KERNEL32.@)180 * GetSystemDefaultLCID (OLE2NLS.2)180 * GetSystemDefaultLCID (KERNEL32.@) 181 * GetSystemDefaultLCID (OLE2NLS.2) 181 182 */ 182 183 LCID WINAPI GetSystemDefaultLCID(void) 183 184 { 184 return GetUserDefaultLCID();185 return GetUserDefaultLCID(); 185 186 } 186 187 #endif //__WIN32OS2__ … … 222 223 if(l_data->lang && strlen(l_data->lang) > 0 && !strcasecmp(l_data->lang, buf_language)) 223 224 { 224 if(l_data->country && strlen(l_data->country) > 0)225 {226 if(!strcasecmp(l_data->country, buf_country))227 {228 l_data->found_lang_id[0] = LangID;229 l_data->n_found = 1;230 TRACE("Found lang_id %04X for %s_%s\n", LangID, l_data->lang, l_data->country);231 return FALSE; /* stop enumeration */232 }233 }234 else /* l_data->country not specified */235 {236 if(l_data->n_found < NLS_MAX_LANGUAGES)237 {238 l_data->found_lang_id[l_data->n_found] = LangID;239 strncpy(l_data->found_country[l_data->n_found], buf_country, 3);240 strncpy(l_data->found_language[l_data->n_found], buf_language, 3);241 l_data->n_found++;242 TRACE("Found lang_id %04X for %s\n", LangID, l_data->lang);243 return TRUE; /* continue search */244 }245 }225 if(l_data->country && strlen(l_data->country) > 0) 226 { 227 if(!strcasecmp(l_data->country, buf_country)) 228 { 229 l_data->found_lang_id[0] = LangID; 230 l_data->n_found = 1; 231 TRACE("Found lang_id %04X for %s_%s\n", LangID, l_data->lang, l_data->country); 232 return FALSE; /* stop enumeration */ 233 } 234 } 235 else /* l_data->country not specified */ 236 { 237 if(l_data->n_found < NLS_MAX_LANGUAGES) 238 { 239 l_data->found_lang_id[l_data->n_found] = LangID; 240 strncpy(l_data->found_country[l_data->n_found], buf_country, 3); 241 strncpy(l_data->found_language[l_data->n_found], buf_language, 3); 242 l_data->n_found++; 243 TRACE("Found lang_id %04X for %s\n", LangID, l_data->lang); 244 return TRUE; /* continue search */ 245 } 246 } 246 247 } 247 248 … … 256 257 if(l_data->lang && strlen(l_data->lang) > 0 && !strcasecmp(l_data->lang, buf_en_language)) 257 258 { 258 l_data->found_lang_id[l_data->n_found] = LangID;259 strncpy(l_data->found_country[l_data->n_found], buf_country, 3);260 strncpy(l_data->found_language[l_data->n_found], buf_language, 3);261 l_data->n_found++;262 TRACE("Found lang_id %04X for %s\n", LangID, l_data->lang);259 l_data->found_lang_id[l_data->n_found] = LangID; 260 strncpy(l_data->found_country[l_data->n_found], buf_country, 3); 261 strncpy(l_data->found_language[l_data->n_found], buf_language, 3); 262 l_data->n_found++; 263 TRACE("Found lang_id %04X for %s\n", LangID, l_data->lang); 263 264 } 264 265 … … 270 271 * 271 272 * INPUT: 272 * Lang: a string whose two first chars are the iso name of a language.273 * Country: a string whose two first chars are the iso name of country274 * Charset: a string defining the chossen charset encoding275 * Dialect: a string defining a variation of the locale273 * Lang: a string whose two first chars are the iso name of a language. 274 * Country: a string whose two first chars are the iso name of country 275 * Charset: a string defining the chossen charset encoding 276 * Dialect: a string defining a variation of the locale 276 277 * 277 * all those values are from the standardized format of locale278 * name in unix which is: Lang[_Country][.Charset][@Dialect]278 * all those values are from the standardized format of locale 279 * name in unix which is: Lang[_Country][.Charset][@Dialect] 279 280 * 280 281 * RETURNS: 281 * the numeric code of the language used by Windows282 * the numeric code of the language used by Windows 282 283 * 283 284 * FIXME: Charset and Dialect are not handled … … 290 291 if(!Lang) 291 292 { 292 l_data.found_lang_id[0] = MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT);293 goto END;293 l_data.found_lang_id[0] = MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT); 294 goto END; 294 295 } 295 296 … … 298 299 299 300 if(Country && strlen(Country) > 0) 300 strncpy(l_data.country, Country, sizeof(l_data.country));301 strncpy(l_data.country, Country, sizeof(l_data.country)); 301 302 302 303 EnumResourceLanguagesA(GetModuleHandleA("KERNEL32"), RT_STRINGA, 303 (LPCSTR)LOCALE_ILANGUAGE, NLS_FindLanguageID_ProcA, (LONG)&l_data);304 (LPCSTR)LOCALE_ILANGUAGE, NLS_FindLanguageID_ProcA, (LONG)&l_data); 304 305 305 306 strcpy(lang_string, l_data.lang); 306 307 if(l_data.country && strlen(l_data.country) > 0) 307 308 { 308 strcat(lang_string, "_");309 strcat(lang_string, l_data.country);309 strcat(lang_string, "_"); 310 strcat(lang_string, l_data.country); 310 311 } 311 312 312 313 if(!l_data.n_found) 313 314 { 314 if(l_data.country && strlen(l_data.country) > 0)315 {316 MESSAGE("Warning: Language '%s' was not found, retrying without country name...\n", lang_string);317 l_data.country[0] = 0;318 EnumResourceLanguagesA(GetModuleHandleA("KERNEL32"), RT_STRINGA,319 (LPCSTR)LOCALE_ILANGUAGE, NLS_FindLanguageID_ProcA, (LONG)&l_data);320 }315 if(l_data.country && strlen(l_data.country) > 0) 316 { 317 MESSAGE("Warning: Language '%s' was not found, retrying without country name...\n", lang_string); 318 l_data.country[0] = 0; 319 EnumResourceLanguagesA(GetModuleHandleA("KERNEL32"), RT_STRINGA, 320 (LPCSTR)LOCALE_ILANGUAGE, NLS_FindLanguageID_ProcA, (LONG)&l_data); 321 } 321 322 } 322 323 … … 325 326 if(l_data.country && strlen(l_data.country) > 0) 326 327 { 327 strcat(lang_string, "_");328 strcat(lang_string, l_data.country);328 strcat(lang_string, "_"); 329 strcat(lang_string, l_data.country); 329 330 } 330 331 331 332 if(!l_data.n_found) 332 333 { 333 MESSAGE("Warning: Language '%s' was not recognized, defaulting to English\n", lang_string);334 l_data.found_lang_id[0] = MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT);334 MESSAGE("Warning: Language '%s' was not recognized, defaulting to English\n", lang_string); 335 l_data.found_lang_id[0] = MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT); 335 336 } 336 337 else 337 338 { 338 if(l_data.n_found == 1)339 TRACE("For language '%s' lang_id %04X was found\n", lang_string, l_data.found_lang_id[0]);340 else /* l_data->n_found > 1 */341 {342 int i;343 MESSAGE("For language '%s' several language ids were found:\n", lang_string);344 for(i = 0; i < l_data.n_found; i++)345 MESSAGE("%s_%s - %04X; ", l_data.found_language[i], l_data.found_country[i], l_data.found_lang_id[i]);346 347 MESSAGE("\nInstead of using first in the list, suggest to define\n"348 "your LANG environment variable like this: LANG=%s_%s\n",349 l_data.found_language[0], l_data.found_country[0]);350 }339 if(l_data.n_found == 1) 340 TRACE("For language '%s' lang_id %04X was found\n", lang_string, l_data.found_lang_id[0]); 341 else /* l_data->n_found > 1 */ 342 { 343 int i; 344 MESSAGE("For language '%s' several language ids were found:\n", lang_string); 345 for(i = 0; i < l_data.n_found; i++) 346 MESSAGE("%s_%s - %04X; ", l_data.found_language[i], l_data.found_country[i], l_data.found_lang_id[i]); 347 348 MESSAGE("\nInstead of using first in the list, suggest to define\n" 349 "your LANG environment variable like this: LANG=%s_%s\n", 350 l_data.found_language[0], l_data.found_country[0]); 351 } 351 352 } 352 353 END: … … 356 357 #ifndef __WIN32OS2__ 357 358 /*********************************************************************** 358 * GetUserDefaultLangID (KERNEL32.@)359 * GetUserDefaultLangID (OLE2NLS.3)359 * GetUserDefaultLangID (KERNEL32.@) 360 * GetUserDefaultLangID (OLE2NLS.3) 360 361 */ 361 362 LANGID WINAPI GetUserDefaultLangID(void) 362 363 { 363 /* caching result, if defined from environment, which should (?) not change during a WINE session */364 static LANGIDuserLCID = 0;365 366 if (userLCID == 0)364 /* caching result, if defined from environment, which should (?) not change during a WINE session */ 365 static LANGID userLCID = 0; 366 367 if (userLCID == 0) 367 368 { 368 369 char buf[256]; 369 char *lang,*country,*charset,*dialect,*next;370 371 if (GetEnvironmentVariableA( "LANGUAGE", buf, sizeof(buf) )) goto ok;372 if (GetEnvironmentVariableA( "LANG", buf, sizeof(buf) )) goto ok;373 if (GetEnvironmentVariableA( "LC_ALL", buf, sizeof(buf) )) goto ok;374 if (GetEnvironmentVariableA( "LC_MESSAGES", buf, sizeof(buf) )) goto ok;375 if (GetEnvironmentVariableA( "LC_CTYPE", buf, sizeof(buf) )) goto ok;376 377 return userLCID = MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT );370 char *lang,*country,*charset,*dialect,*next; 371 372 if (GetEnvironmentVariableA( "LANGUAGE", buf, sizeof(buf) )) goto ok; 373 if (GetEnvironmentVariableA( "LANG", buf, sizeof(buf) )) goto ok; 374 if (GetEnvironmentVariableA( "LC_ALL", buf, sizeof(buf) )) goto ok; 375 if (GetEnvironmentVariableA( "LC_MESSAGES", buf, sizeof(buf) )) goto ok; 376 if (GetEnvironmentVariableA( "LC_CTYPE", buf, sizeof(buf) )) goto ok; 377 378 return userLCID = MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ); 378 379 379 380 ok: 380 if (!strcmp(buf,"POSIX") || !strcmp(buf,"C"))381 if (!strcmp(buf,"POSIX") || !strcmp(buf,"C")) 381 382 return userLCID = MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ); 382 383 lang=buf;384 385 do {386 next=strchr(lang,':'); if (next) *next++='\0';387 dialect=strchr(lang,'@'); if (dialect) *dialect++='\0';388 charset=strchr(lang,'.'); if (charset) *charset++='\0';389 country=strchr(lang,'_'); if (country) *country++='\0';390 391 userLCID = NLS_GetLanguageID(lang, country, charset, dialect);392 393 lang=next;394 } while (lang && !userLCID);395 396 if (!userLCID)383 384 lang=buf; 385 386 do { 387 next=strchr(lang,':'); if (next) *next++='\0'; 388 dialect=strchr(lang,'@'); if (dialect) *dialect++='\0'; 389 charset=strchr(lang,'.'); if (charset) *charset++='\0'; 390 country=strchr(lang,'_'); if (country) *country++='\0'; 391 392 userLCID = NLS_GetLanguageID(lang, country, charset, dialect); 393 394 lang=next; 395 } while (lang && !userLCID); 396 397 if (!userLCID) 397 398 { 398 399 MESSAGE( "Warning: language '%s' not recognized, defaulting to English\n", … … 400 401 userLCID = MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ); 401 402 } 402 }403 return userLCID;403 } 404 return userLCID; 404 405 } 405 406 406 407 /*********************************************************************** 407 * GetSystemDefaultLangID (KERNEL32.@)408 * GetSystemDefaultLangID (OLE2NLS.4)408 * GetSystemDefaultLangID (KERNEL32.@) 409 * GetSystemDefaultLangID (OLE2NLS.4) 409 410 */ 410 411 LANGID WINAPI GetSystemDefaultLangID(void) 411 412 { 412 return GetUserDefaultLangID();413 return GetUserDefaultLangID(); 413 414 } 414 415 #endif //__WIN32OS2__ 415 416 /****************************************************************************** 416 * ConvertDefaultLocale (KERNEL32.@)417 * ConvertDefaultLocale (KERNEL32.@) 417 418 */ 418 419 LCID WINAPI ConvertDefaultLocale (LCID lcid) 419 { switch (lcid)420 { case LOCALE_SYSTEM_DEFAULT:421 return GetSystemDefaultLCID();422 case LOCALE_USER_DEFAULT:423 return GetUserDefaultLCID();424 case LOCALE_NEUTRAL:425 return MAKELCID (LANG_NEUTRAL, SUBLANG_NEUTRAL);426 } 427 return MAKELANGID( PRIMARYLANGID(lcid), SUBLANG_NEUTRAL);420 { switch (lcid) 421 { case LOCALE_SYSTEM_DEFAULT: 422 return GetSystemDefaultLCID(); 423 case LOCALE_USER_DEFAULT: 424 return GetUserDefaultLCID(); 425 case LOCALE_NEUTRAL: 426 return MAKELCID (LANG_NEUTRAL, SUBLANG_NEUTRAL); 427 } 428 return MAKELANGID( PRIMARYLANGID(lcid), SUBLANG_NEUTRAL); 428 429 } 429 430 … … 447 448 hmem = LoadResource(hModule, hrsrc); 448 449 if(!hmem) return 0; 449 450 450 451 #ifdef __WIN32OS2__ 451 452 p = (WCHAR*)LockResource(hmem); … … 455 456 string_num = res_id & 0x000f; 456 457 for(i = 0; i < string_num; i++) 457 p += *p + 1;458 458 p += *p + 1; 459 459 460 TRACE("strlen = %d\n", (int)*p ); 460 461 461 462 if (buffer == NULL) return *p; 462 463 i = min(buflen - 1, *p); 463 464 if (i > 0) { 464 memcpy(buffer, p + 1, i * sizeof (WCHAR));465 buffer[i] = (WCHAR) 0;465 memcpy(buffer, p + 1, i * sizeof (WCHAR)); 466 buffer[i] = (WCHAR) 0; 466 467 } else { 467 if (buflen > 1)468 buffer[0] = (WCHAR) 0;468 if (buflen > 1) 469 buffer[0] = (WCHAR) 0; 469 470 } 470 471 … … 475 476 #ifndef __WIN32OS2__ 476 477 /****************************************************************************** 477 * GetLocaleInfoA (KERNEL32.@)478 * GetLocaleInfoA (KERNEL32.@) 478 479 * 479 * NOTES 480 * NOTES 480 481 * LANG_NEUTRAL is equal to LOCALE_SYSTEM_DEFAULT 481 482 * … … 487 488 { 488 489 LPCSTR retString = NULL; 489 int found = 0, i;490 int found = 0, i; 490 491 char *pacKey; 491 492 char acBuffer[128]; … … 497 498 if (len && (! buf) ) { 498 499 SetLastError(ERROR_INSUFFICIENT_BUFFER); 499 return 0;500 }501 502 if (lcid == LOCALE_NEUTRAL || lcid == LANG_SYSTEM_DEFAULT)503 {500 return 0; 501 } 502 503 if (lcid == LOCALE_NEUTRAL || lcid == LANG_SYSTEM_DEFAULT) 504 { 504 505 lcid = GetSystemDefaultLCID(); 505 } 506 else if (lcid == LANG_USER_DEFAULT) /*0x800*/507 {506 } 507 else if (lcid == LANG_USER_DEFAULT) /*0x800*/ 508 { 508 509 lcid = GetUserDefaultLCID(); 509 }510 } 510 511 511 512 /* LOCALE_NOUSEROVERRIDE means: do not get user redefined settings … … 513 514 NoUserOverride = (LCType & LOCALE_NOUSEROVERRIDE) != 0; 514 515 515 LCType &= ~(LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP);516 LCType &= ~(LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP); 516 517 517 518 /* First, check if it's in the registry. */ … … 524 525 sprintf( acRealKey, "Control Panel\\International\\%s", pacKey ); 525 526 526 if ( RegOpenKeyExA( HKEY_CURRENT_USER, acRealKey, 527 if ( RegOpenKeyExA( HKEY_CURRENT_USER, acRealKey, 527 528 0, KEY_READ, &hKey) == ERROR_SUCCESS ) 528 529 { 529 if ( RegQueryValueExA( hKey, NULL, NULL, NULL, (LPBYTE)acBuffer, 530 if ( RegQueryValueExA( hKey, NULL, NULL, NULL, (LPBYTE)acBuffer, 530 531 &dwBufferSize ) == ERROR_SUCCESS ) 531 532 { … … 539 540 /* If not in the registry, get it from the NLS entries. */ 540 541 if(!found) { 541 WCHAR wcBuffer[128];542 int res_size;543 544 /* check if language is registered in the kernel32 resources */545 if((res_size = NLS_LoadStringExW(GetModuleHandleA("KERNEL32"), LANGIDFROMLCID(lcid),546 LCType, wcBuffer, sizeof(wcBuffer)/sizeof(wcBuffer[0])))) {547 WideCharToMultiByte(CP_ACP, 0, wcBuffer, res_size, acBuffer, dwBufferSize, NULL, NULL);548 retString = acBuffer;549 found = 1;550 }542 WCHAR wcBuffer[128]; 543 int res_size; 544 545 /* check if language is registered in the kernel32 resources */ 546 if((res_size = NLS_LoadStringExW(GetModuleHandleA("KERNEL32"), LANGIDFROMLCID(lcid), 547 LCType, wcBuffer, sizeof(wcBuffer)/sizeof(wcBuffer[0])))) { 548 WideCharToMultiByte(CP_ACP, 0, wcBuffer, res_size, acBuffer, dwBufferSize, NULL, NULL); 549 retString = acBuffer; 550 found = 1; 551 } 551 552 } 552 553 553 554 /* if not found report a most descriptive error */ 554 555 if(!found) { 555 retString=0;556 /* If we are through all of this, retLen should not be zero anymore.557 If it is, the value is not supported */558 i=0;559 while (locale_name2id[i].name!=NULL) {560 if (LCType == locale_name2id[i].id) {561 retString = locale_name2id[i].name;562 break;563 }564 i++;565 }566 if(!retString)567 FIXME("Unkown LC type %lX\n", LCType);568 else569 FIXME("'%s' is not defined for your language (%04X).\n"570 "Please define it in dlls/kernel/nls/YourLanguage.nls\n"571 "and submit patch for inclusion into the next Wine release.\n",572 retString, LOWORD(lcid));573 SetLastError(ERROR_INVALID_PARAMETER);574 return 0; 556 retString=0; 557 /* If we are through all of this, retLen should not be zero anymore. 558 If it is, the value is not supported */ 559 i=0; 560 while (locale_name2id[i].name!=NULL) { 561 if (LCType == locale_name2id[i].id) { 562 retString = locale_name2id[i].name; 563 break; 564 } 565 i++; 566 } 567 if(!retString) 568 FIXME("Unkown LC type %lX\n", LCType); 569 else 570 FIXME("'%s' is not defined for your language (%04X).\n" 571 "Please define it in dlls/kernel/nls/YourLanguage.nls\n" 572 "and submit patch for inclusion into the next Wine release.\n", 573 retString, LOWORD(lcid)); 574 SetLastError(ERROR_INVALID_PARAMETER); 575 return 0; 575 576 } 576 577 … … 578 579 if (LCType == LOCALE_FONTSIGNATURE) { 579 580 if (len) { 580 len = (len < sizeof(FONTSIGNATURE)) ? len : sizeof(FONTSIGNATURE);581 len = (len < sizeof(FONTSIGNATURE)) ? len : sizeof(FONTSIGNATURE); 581 582 memcpy(buf, retString, len); 582 return len;583 }583 return len; 584 } 584 585 return sizeof(FONTSIGNATURE); 585 586 } 586 587 /* if len=0 return only the length, don't touch the buffer*/ 587 588 if (len) { 588 lstrcpynA(buf,retString,len);589 return strlen(buf) + 1;589 lstrcpynA(buf,retString,len); 590 return strlen(buf) + 1; 590 591 } 591 592 return strlen(retString)+1; … … 593 594 594 595 /****************************************************************************** 595 * GetLocaleInfoW (KERNEL32.@)596 * GetLocaleInfoW (KERNEL32.@) 596 597 * 597 598 * NOTES … … 601 602 */ 602 603 INT WINAPI GetLocaleInfoW(LCID lcid,LCTYPE LCType,LPWSTR wbuf,INT len) 603 { WORD wlen;604 LPSTR abuf;605 606 if (len && (! wbuf) )607 { SetLastError(ERROR_INSUFFICIENT_BUFFER);608 return 0;609 }610 611 abuf = (LPSTR)HeapAlloc(GetProcessHeap(),0,len);612 wlen = GetLocaleInfoA(lcid, LCType, abuf, len);613 614 if (wlen && len)/* if len=0 return only the length*/604 { WORD wlen; 605 LPSTR abuf; 606 607 if (len && (! wbuf) ) 608 { SetLastError(ERROR_INSUFFICIENT_BUFFER); 609 return 0; 610 } 611 612 abuf = (LPSTR)HeapAlloc(GetProcessHeap(),0,len); 613 wlen = GetLocaleInfoA(lcid, LCType, abuf, len); 614 615 if (wlen && len) /* if len=0 return only the length*/ 615 616 MultiByteToWideChar( CP_ACP, 0, abuf, -1, wbuf, len ); 616 617 617 HeapFree(GetProcessHeap(),0,abuf);618 return wlen;618 HeapFree(GetProcessHeap(),0,abuf); 619 return wlen; 619 620 } 620 621 #endif //__WIN32OS2__ … … 622 623 /****************************************************************************** 623 624 * 624 * GetLocaleSubkeyName [helper function]625 * GetLocaleSubkeyName [helper function] 625 626 * 626 627 * - For use with the registry. … … 730 731 break; 731 732 732 /* The following are not listed under MSDN as supported, 733 /* The following are not listed under MSDN as supported, 733 734 * but seem to be used and also stored in the registry. 734 735 */ … … 755 756 756 757 /****************************************************************************** 757 * SetLocaleInfoA[KERNEL32.656]758 * SetLocaleInfoA [KERNEL32.656] 758 759 */ 759 760 BOOL WINAPI SetLocaleInfoA(DWORD lcid, DWORD lctype, LPCSTR data) … … 766 767 { 767 768 sprintf( acRealKey, "Control Panel\\International\\%s", pacKey ); 768 if ( RegCreateKeyA( HKEY_CURRENT_USER, acRealKey, 769 if ( RegCreateKeyA( HKEY_CURRENT_USER, acRealKey, 769 770 &hKey ) == ERROR_SUCCESS ) 770 771 { 771 if ( RegSetValueExA( hKey, NULL, 0, REG_SZ, 772 if ( RegSetValueExA( hKey, NULL, 0, REG_SZ, 772 773 #ifdef __WIN32OS2__ 773 774 (LPBYTE)data, strlen(data)+1 ) != ERROR_SUCCESS ) … … 829 830 830 831 /****************************************************************************** 831 * IsValidLocale[KERNEL32.489]832 * IsValidLocale [KERNEL32.489] 832 833 */ 833 834 BOOL WINAPI IsValidLocale(LCID lcid,DWORD flags) … … 840 841 /* check if language is registered in the kernel32 resources */ 841 842 if(!FindResourceExW(GetModuleHandleA("KERNEL32"), RT_STRINGW, (LPCWSTR)LOCALE_ILANGUAGE, LOWORD(lcid))) 842 return FALSE;843 return FALSE; 843 844 else 844 return TRUE;845 return TRUE; 845 846 #endif 846 847 } 847 848 848 849 static BOOL CALLBACK EnumResourceLanguagesProcW(HMODULE hModule, LPCWSTR type, 849 LPCWSTR name, WORD LangID, LONG lParam)850 LPCWSTR name, WORD LangID, LONG lParam) 850 851 { 851 852 CHAR bufA[20]; … … 858 859 859 860 /****************************************************************************** 860 * EnumSystemLocalesW[KERNEL32.209]861 * EnumSystemLocalesW [KERNEL32.209] 861 862 */ 862 863 BOOL WINAPI EnumSystemLocalesW( LOCALE_ENUMPROCW lpfnLocaleEnum, … … 866 867 867 868 EnumResourceLanguagesW(GetModuleHandleA("KERNEL32"), RT_STRINGW, 868 (LPCWSTR)LOCALE_ILANGUAGE, EnumResourceLanguagesProcW,869 (LONG)lpfnLocaleEnum);869 (LPCWSTR)LOCALE_ILANGUAGE, EnumResourceLanguagesProcW, 870 (LONG)lpfnLocaleEnum); 870 871 871 872 return TRUE; … … 873 874 874 875 static BOOL CALLBACK EnumResourceLanguagesProcA(HMODULE hModule, LPCSTR type, 875 LPCSTR name, WORD LangID, LONG lParam)876 LPCSTR name, WORD LangID, LONG lParam) 876 877 { 877 878 CHAR bufA[20]; … … 882 883 883 884 /****************************************************************************** 884 * EnumSystemLocalesA[KERNEL32.208]885 * EnumSystemLocalesA [KERNEL32.208] 885 886 */ 886 887 BOOL WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA lpfnLocaleEnum, … … 890 891 891 892 EnumResourceLanguagesA(GetModuleHandleA("KERNEL32"), RT_STRINGA, 892 (LPCSTR)LOCALE_ILANGUAGE, EnumResourceLanguagesProcA,893 (LONG)lpfnLocaleEnum);893 (LPCSTR)LOCALE_ILANGUAGE, EnumResourceLanguagesProcA, 894 (LONG)lpfnLocaleEnum); 894 895 895 896 return TRUE; … … 1156 1157 }; 1157 1158 1158 const WORD OLE2NLS_CT_CType3_LUT[] = { 1159 const WORD OLE2NLS_CT_CType3_LUT[] = { 1159 1160 0x0000, /* - 0 */ 1160 1161 0x0000, /* - 1 */ … … 1417 1418 1418 1419 /****************************************************************************** 1419 * GetStringTypeA[KERNEL32.396]1420 * GetStringTypeA [KERNEL32.396] 1420 1421 */ 1421 1422 BOOL WINAPI GetStringTypeA(LCID locale,DWORD dwInfoType,LPCSTR src, 1422 1423 INT cchSrc,LPWORD chartype) 1423 1424 { 1424 return GetStringTypeExA(locale,dwInfoType,src,cchSrc,chartype);1425 return GetStringTypeExA(locale,dwInfoType,src,cchSrc,chartype); 1425 1426 } 1426 1427 1427 1428 /****************************************************************************** 1428 * GetStringTypeExA[KERNEL32.397]1429 * GetStringTypeExA [KERNEL32.397] 1429 1430 * 1430 1431 * FIXME: Ignores the locale. … … 1433 1434 INT cchSrc,LPWORD chartype) 1434 1435 { 1435 inti;1436 1437 if ((src==NULL) || (chartype==NULL) || (src==(LPSTR)chartype))1438 {1439 SetLastError(ERROR_INVALID_PARAMETER);1440 return FALSE;1441 }1442 1443 if (cchSrc==-1)1444 cchSrc=strlen(src)+1;1445 1446 switch (dwInfoType) {1447 case CT_CTYPE1:1448 for (i=0;i<cchSrc;i++) 1449 {1450 chartype[i] = 0;1451 if (isdigit(src[i])) chartype[i]|=C1_DIGIT;1452 if (isalpha(src[i])) chartype[i]|=C1_ALPHA;1453 if (islower(src[i])) chartype[i]|=C1_LOWER;1454 if (isupper(src[i])) chartype[i]|=C1_UPPER;1455 if (isspace(src[i])) chartype[i]|=C1_SPACE;1456 if (ispunct(src[i])) chartype[i]|=C1_PUNCT;1457 if (iscntrl(src[i])) chartype[i]|=C1_CNTRL;1436 int i; 1437 1438 if ((src==NULL) || (chartype==NULL) || (src==(LPSTR)chartype)) 1439 { 1440 SetLastError(ERROR_INVALID_PARAMETER); 1441 return FALSE; 1442 } 1443 1444 if (cchSrc==-1) 1445 cchSrc=strlen(src)+1; 1446 1447 switch (dwInfoType) { 1448 case CT_CTYPE1: 1449 for (i=0;i<cchSrc;i++) 1450 { 1451 chartype[i] = 0; 1452 if (isdigit(src[i])) chartype[i]|=C1_DIGIT; 1453 if (isalpha(src[i])) chartype[i]|=C1_ALPHA; 1454 if (islower(src[i])) chartype[i]|=C1_LOWER; 1455 if (isupper(src[i])) chartype[i]|=C1_UPPER; 1456 if (isspace(src[i])) chartype[i]|=C1_SPACE; 1457 if (ispunct(src[i])) chartype[i]|=C1_PUNCT; 1458 if (iscntrl(src[i])) chartype[i]|=C1_CNTRL; 1458 1459 /* FIXME: isblank() is a GNU extension */ 1459 /* if (isblank(src[i])) chartype[i]|=C1_BLANK; */1460 if ((src[i] == ' ') || (src[i] == '\t')) chartype[i]|=C1_BLANK;1461 /* C1_XDIGIT */1462 }1463 return TRUE;1464 1465 case CT_CTYPE2:1466 for (i=0;i<cchSrc;i++) 1467 {1468 chartype[i]=(WORD)CT_CType2_LUT[i];1469 }1470 return TRUE;1471 1472 case CT_CTYPE3:1473 for (i=0;i<cchSrc;i++) 1474 {1475 chartype[i]=OLE2NLS_CT_CType3_LUT[i];1476 }1477 return TRUE;1478 1479 default:1480 ERR("Unknown dwInfoType:%ld\n",dwInfoType);1481 return FALSE;1482 }1460 /* if (isblank(src[i])) chartype[i]|=C1_BLANK; */ 1461 if ((src[i] == ' ') || (src[i] == '\t')) chartype[i]|=C1_BLANK; 1462 /* C1_XDIGIT */ 1463 } 1464 return TRUE; 1465 1466 case CT_CTYPE2: 1467 for (i=0;i<cchSrc;i++) 1468 { 1469 chartype[i]=(WORD)CT_CType2_LUT[i]; 1470 } 1471 return TRUE; 1472 1473 case CT_CTYPE3: 1474 for (i=0;i<cchSrc;i++) 1475 { 1476 chartype[i]=OLE2NLS_CT_CType3_LUT[i]; 1477 } 1478 return TRUE; 1479 1480 default: 1481 ERR("Unknown dwInfoType:%ld\n",dwInfoType); 1482 return FALSE; 1483 } 1483 1484 } 1484 1485 … … 1489 1490 { 1490 1491 if(!szLang) 1491 return 0;1492 return 0; 1492 1493 1493 1494 return GetLocaleInfoA(MAKELCID(wLang, SORT_DEFAULT), LOCALE_SENGLANGUAGE, szLang, nSize); … … 1500 1501 { 1501 1502 if(!szLang) 1502 return 0;1503 return 0; 1503 1504 1504 1505 return GetLocaleInfoW(MAKELCID(wLang, SORT_DEFAULT), LOCALE_SENGLANGUAGE, szLang, nSize); 1505 1506 } 1506 1507 1507 1508 1508 1509 static const unsigned char LCM_Unicode_LUT[] = { 1509 6 , 3, /* - 1 */ 1510 6 , 4, /* - 2 */ 1511 6 , 5, /* - 3 */ 1512 6 , 6, /* - 4 */ 1513 6 , 7, /* - 5 */ 1514 6 , 8, /* - 6 */ 1515 6 , 9, /* - 7 */ 1516 6 , 10, /* - 8 */ 1517 7 , 5, /* - 9 */ 1518 7 , 6, /* - 10 */ 1519 7 , 7, /* - 11 */ 1520 7 , 8, /* - 12 */ 1521 7 , 9, /* - 13 */ 1522 6 , 11, /* - 14 */ 1523 6 , 12, /* - 15 */ 1524 6 , 13, /* - 16 */ 1525 6 , 14, /* - 17 */ 1526 6 , 15, /* - 18 */ 1527 6 , 16, /* - 19 */ 1528 6 , 17, /* - 20 */ 1529 6 , 18, /* - 21 */ 1530 6 , 19, /* - 22 */ 1531 6 , 20, /* - 23 */ 1532 6 , 21, /* - 24 */ 1533 6 , 22, /* - 25 */ 1534 6 , 23, /* - 26 */ 1535 6 , 24, /* - 27 */ 1536 6 , 25, /* - 28 */ 1537 6 , 26, /* - 29 */ 1538 6 , 27, /* - 30 */ 1539 6 , 28, /* - 31 */ 1510 6 , 3, /* - 1 */ 1511 6 , 4, /* - 2 */ 1512 6 , 5, /* - 3 */ 1513 6 , 6, /* - 4 */ 1514 6 , 7, /* - 5 */ 1515 6 , 8, /* - 6 */ 1516 6 , 9, /* - 7 */ 1517 6 , 10, /* - 8 */ 1518 7 , 5, /* - 9 */ 1519 7 , 6, /* - 10 */ 1520 7 , 7, /* - 11 */ 1521 7 , 8, /* - 12 */ 1522 7 , 9, /* - 13 */ 1523 6 , 11, /* - 14 */ 1524 6 , 12, /* - 15 */ 1525 6 , 13, /* - 16 */ 1526 6 , 14, /* - 17 */ 1527 6 , 15, /* - 18 */ 1528 6 , 16, /* - 19 */ 1529 6 , 17, /* - 20 */ 1530 6 , 18, /* - 21 */ 1531 6 , 19, /* - 22 */ 1532 6 , 20, /* - 23 */ 1533 6 , 21, /* - 24 */ 1534 6 , 22, /* - 25 */ 1535 6 , 23, /* - 26 */ 1536 6 , 24, /* - 27 */ 1537 6 , 25, /* - 28 */ 1538 6 , 26, /* - 29 */ 1539 6 , 27, /* - 30 */ 1540 6 , 28, /* - 31 */ 1540 1541 7 , 2, /* - 32 */ 1541 1542 7 , 28, /* ! - 33 */ … … 1768 1769 #define LCM_Diacritic_Start 131 1769 1770 1770 static const unsigned char LCM_Diacritic_LUT[] = { 1771 static const unsigned char LCM_Diacritic_LUT[] = { 1771 1772 123, /* - 131 */ 1772 1773 2, /* - 132 */ … … 1900 1901 * OLE2NLS_isPunctuation [INTERNAL] 1901 1902 */ 1902 static int OLE2NLS_isPunctuation(unsigned char c) 1903 { 1904 /* "punctuation character" in this context is a character which is 1903 static int OLE2NLS_isPunctuation(unsigned char c) 1904 { 1905 /* "punctuation character" in this context is a character which is 1905 1906 considered "less important" during word sort comparison. 1906 See LCMapString implementation for the precise definition 1907 See LCMapString implementation for the precise definition 1907 1908 of "less important". */ 1908 1909 … … 1913 1914 * OLE2NLS_isNonSpacing [INTERNAL] 1914 1915 */ 1915 static int OLE2NLS_isNonSpacing(unsigned char c) 1916 { 1917 /* This function is used by LCMapStringA. Characters 1916 static int OLE2NLS_isNonSpacing(unsigned char c) 1917 { 1918 /* This function is used by LCMapStringA. Characters 1918 1919 for which it returns true are ignored when mapping a 1919 1920 string with NORM_IGNORENONSPACE */ … … 1924 1925 * OLE2NLS_isSymbol [INTERNAL] 1925 1926 */ 1926 static int OLE2NLS_isSymbol(unsigned char c) 1927 { 1928 /* This function is used by LCMapStringA. Characters 1927 static int OLE2NLS_isSymbol(unsigned char c) 1928 { 1929 /* This function is used by LCMapStringA. Characters 1929 1930 for which it returns true are ignored when mapping a 1930 1931 string with NORM_IGNORESYMBOLS */ … … 1937 1938 1938 1939 /****************************************************************************** 1939 * identity[Internal]1940 * identity [Internal] 1940 1941 */ 1941 1942 #ifdef __WIN32OS2__ … … 1963 1964 * NOTES 1964 1965 * If called with scrlen = -1, the function will compute the length 1965 * of the 0-terminated string strsrc by itself. 1966 * 1967 * If called with dstlen = 0, returns the buffer length that 1966 * of the 0-terminated string strsrc by itself. 1967 * 1968 * If called with dstlen = 0, returns the buffer length that 1968 1969 * would be required. 1969 1970 * 1970 1971 * NORM_IGNOREWIDTH means to compare ASCII and wide characters 1971 * as if they are equal. 1972 * as if they are equal. 1972 1973 * In the only code page implemented so far, there may not be 1973 1974 * wide characters in strings passed to LCMapStringA, … … 1976 1977 #ifdef __WIN32OS2__ 1977 1978 ODINFUNCTION6(INT, LCMapStringA, 1978 LCID, lcid, /* [in] locale identifier created with MAKELCID; 1979 LOCALE_SYSTEM_DEFAULT and LOCALE_USER_DEFAULT are 1979 LCID, lcid, /* [in] locale identifier created with MAKELCID; 1980 LOCALE_SYSTEM_DEFAULT and LOCALE_USER_DEFAULT are 1980 1981 predefined values. */ 1981 DWORD, mapflags, /* [in] flags */1982 LPCSTR, srcstr, /* [in] source buffer */1983 INT, srclen, /* [in] source length */1984 LPSTR, dststr, /* [out] destination buffer */1985 INT, dstlen) /* [in] destination buffer length */1982 DWORD, mapflags, /* [in] flags */ 1983 LPCSTR, srcstr, /* [in] source buffer */ 1984 INT, srclen, /* [in] source length */ 1985 LPSTR, dststr, /* [out] destination buffer */ 1986 INT, dstlen) /* [in] destination buffer length */ 1986 1987 #else 1987 1988 INT WINAPI LCMapStringA( 1988 LCID lcid, /* [in] locale identifier created with MAKELCID; 1989 LOCALE_SYSTEM_DEFAULT and LOCALE_USER_DEFAULT are 1989 LCID lcid, /* [in] locale identifier created with MAKELCID; 1990 LOCALE_SYSTEM_DEFAULT and LOCALE_USER_DEFAULT are 1990 1991 predefined values. */ 1991 DWORD mapflags, /* [in] flags */1992 LPCSTR srcstr, /* [in] source buffer */1993 INT srclen, /* [in] source length */1994 LPSTR dststr, /* [out] destination buffer */1995 INT dstlen) /* [in] destination buffer length */1992 DWORD mapflags, /* [in] flags */ 1993 LPCSTR srcstr, /* [in] source buffer */ 1994 INT srclen, /* [in] source length */ 1995 LPSTR dststr, /* [out] destination buffer */ 1996 INT dstlen) /* [in] destination buffer length */ 1996 1997 #endif 1997 1998 { … … 1999 2000 2000 2001 TRACE("(0x%04lx,0x%08lx,%s,%d,%p,%d)\n", 2001 lcid,mapflags,srcstr,srclen,dststr,dstlen);2002 lcid,mapflags,srcstr,srclen,dststr,dstlen); 2002 2003 2003 2004 if ( ((dstlen!=0) && (dststr==NULL)) || (srcstr==NULL) ) … … 2007 2008 return 0; 2008 2009 } 2009 if (srclen == -1) 2010 if (srclen == -1) 2010 2011 srclen = strlen(srcstr) + 1 ; /* (include final '\0') */ 2011 2012 … … 2018 2019 NORM_IGNOREWIDTH | \ 2019 2020 NORM_IGNOREKANATYPE) 2020 /* FIXME: as long as we don't support Katakana nor Hiragana 2021 /* FIXME: as long as we don't support Katakana nor Hiragana 2021 2022 * characters, we can support NORM_IGNOREKANATYPE 2022 2023 */ … … 2024 2025 { 2025 2026 FIXME("(0x%04lx,0x%08lx,%p,%d,%p,%d): " 2026 "unimplemented flags: 0x%08lx\n",2027 lcid,2028 mapflags,2029 srcstr,2030 srclen,2031 dststr,2032 dstlen,2033 mapflags & ~LCMAPSTRINGA_SUPPORTED_FLAGS2027 "unimplemented flags: 0x%08lx\n", 2028 lcid, 2029 mapflags, 2030 srcstr, 2031 srclen, 2032 dststr, 2033 dstlen, 2034 mapflags & ~LCMAPSTRINGA_SUPPORTED_FLAGS 2034 2035 ); 2035 2036 } … … 2039 2040 int i,j; 2040 2041 #ifdef __WIN32OS2__ 2041 int (* _Optlink f)(int) = identity; 2042 int (* _Optlink f)(int) = identity; 2042 2043 #else 2043 int (* f)(int) = identity; 2044 int (* f)(int) = identity; 2044 2045 #endif 2045 2046 int flag_ignorenonspace = mapflags & NORM_IGNORENONSPACE; … … 2048 2049 if (flag_ignorenonspace || flag_ignoresymbols) 2049 2050 { 2050 /* For some values of mapflags, the length of the resulting 2051 string is not known at this point. Windows does map the string2052 and does not SetLastError ERROR_INSUFFICIENT_BUFFER in2053 these cases. */2051 /* For some values of mapflags, the length of the resulting 2052 string is not known at this point. Windows does map the string 2053 and does not SetLastError ERROR_INSUFFICIENT_BUFFER in 2054 these cases. */ 2054 2055 if (dstlen==0) 2055 2056 { 2056 /* Compute required length */2057 for (i=j=0; i < srclen; i++)2058 {2059 if ( !(flag_ignorenonspace && OLE2NLS_isNonSpacing(srcstr[i]))2060 && !(flag_ignoresymbols && OLE2NLS_isSymbol(srcstr[i])) )2061 j++;2062 }2063 return j;2057 /* Compute required length */ 2058 for (i=j=0; i < srclen; i++) 2059 { 2060 if ( !(flag_ignorenonspace && OLE2NLS_isNonSpacing(srcstr[i])) 2061 && !(flag_ignoresymbols && OLE2NLS_isSymbol(srcstr[i])) ) 2062 j++; 2063 } 2064 return j; 2064 2065 } 2065 2066 } … … 2067 2068 { 2068 2069 if (dstlen==0) 2069 return srclen; 2070 if (dstlen<srclen) 2071 {2072 SetLastError(ERROR_INSUFFICIENT_BUFFER);2073 return 0;2074 }2070 return srclen; 2071 if (dstlen<srclen) 2072 { 2073 SetLastError(ERROR_INSUFFICIENT_BUFFER); 2074 return 0; 2075 } 2075 2076 } 2076 2077 if (mapflags & LCMAP_UPPERCASE) … … 2082 2083 { 2083 2084 if ( !(flag_ignorenonspace && OLE2NLS_isNonSpacing(srcstr[i])) 2084 && !(flag_ignoresymbols && OLE2NLS_isSymbol(srcstr[i])) )2085 && !(flag_ignoresymbols && OLE2NLS_isSymbol(srcstr[i])) ) 2085 2086 { 2086 dststr[j] = (CHAR) f(srcstr[i]);2087 j++;2087 dststr[j] = (CHAR) f(srcstr[i]); 2088 j++; 2088 2089 } 2089 2090 } … … 2109 2110 int ofs; 2110 2111 unsigned char source_char = srcstr[i]; 2111 if (source_char!='\0') 2112 if (source_char!='\0') 2112 2113 { 2113 if (flag_stringsort || !OLE2NLS_isPunctuation(source_char))2114 {2115 unicode_len++;2116 if ( LCM_Unicode_LUT[-2+2*source_char] & ~15 )2117 unicode_len++; /* double letter */2118 }2119 else2120 {2121 delayed_punctuation_len++;2122 } 2114 if (flag_stringsort || !OLE2NLS_isPunctuation(source_char)) 2115 { 2116 unicode_len++; 2117 if ( LCM_Unicode_LUT[-2+2*source_char] & ~15 ) 2118 unicode_len++; /* double letter */ 2119 } 2120 else 2121 { 2122 delayed_punctuation_len++; 2123 } 2123 2124 } 2124 2125 2125 2126 if (isupper(source_char)) 2126 case_len=unicode_len; 2127 case_len=unicode_len; 2127 2128 2128 2129 ofs = source_char - LCM_Diacritic_Start; 2129 2130 if ((ofs>=0) && (LCM_Diacritic_LUT[ofs]!=2)) 2130 diacritic_len=unicode_len;2131 diacritic_len=unicode_len; 2131 2132 } 2132 2133 2133 2134 if (mapflags & NORM_IGNORECASE) 2134 case_len=0; 2135 case_len=0; 2135 2136 if (mapflags & NORM_IGNORENONSPACE) 2136 2137 diacritic_len=0; … … 2143 2144 + 1 ; /* terminal '\0' */ 2144 2145 if (dstlen==0) 2145 return room; 2146 return room; 2146 2147 else if (dstlen<room) 2147 2148 { … … 2159 2160 /* locate each component, write separators */ 2160 2161 diacritic_component = dststr + 2*unicode_len ; 2161 *diacritic_component++ = '\1'; 2162 *diacritic_component++ = '\1'; 2162 2163 case_component = diacritic_component + diacritic_len ; 2163 *case_component++ = '\1'; 2164 *case_component++ = '\1'; 2164 2165 delayed_punctuation_component = case_component + case_len ; 2165 2166 *delayed_punctuation_component++ = '\1'; 2166 2167 *delayed_punctuation_component++ = '\1'; 2167 2168 2168 /* read source string char by char, write 2169 /* read source string char by char, write 2169 2170 corresponding weight in each component. */ 2170 2171 for (i=0,count=0;i<srclen;i++) 2171 2172 { 2172 2173 unsigned char source_char=srcstr[i]; 2173 if (source_char!='\0') 2174 if (source_char!='\0') 2174 2175 { 2175 int type,longcode;2176 type = LCM_Unicode_LUT[-2+2*source_char];2177 longcode = type >> 4;2178 type &= 15;2179 if (!flag_stringsort && OLE2NLS_isPunctuation(source_char)) 2180 {2181 WORD encrypted_location = (1<<15) + 7 + 4*count;2182 *delayed_punctuation_component++ = (unsigned char) (encrypted_location>>8);2183 *delayed_punctuation_component++ = (unsigned char) (encrypted_location&255);2176 int type,longcode; 2177 type = LCM_Unicode_LUT[-2+2*source_char]; 2178 longcode = type >> 4; 2179 type &= 15; 2180 if (!flag_stringsort && OLE2NLS_isPunctuation(source_char)) 2181 { 2182 WORD encrypted_location = (1<<15) + 7 + 4*count; 2183 *delayed_punctuation_component++ = (unsigned char) (encrypted_location>>8); 2184 *delayed_punctuation_component++ = (unsigned char) (encrypted_location&255); 2184 2185 /* big-endian is used here because it lets string comparison be 2185 compatible with numerical comparison */2186 2187 *delayed_punctuation_component++ = type;2188 *delayed_punctuation_component++ = LCM_Unicode_LUT[-1+2*source_char]; 2189 /* assumption : a punctuation character is never a 2190 double or accented letter */2191 }2192 else2193 {2194 dststr[2*count] = type;2195 dststr[2*count+1] = LCM_Unicode_LUT[-1+2*source_char]; 2196 if (longcode)2197 {2198 if (count<case_len)2199 case_component[count] = ( isupper(source_char) ? 18 : 2 ) ;2200 if (count<diacritic_len)2201 diacritic_component[count] = 2; /* assumption: a double letter2202 is never accented */2203 count++;2204 2205 dststr[2*count] = type;2206 dststr[2*count+1] = *(LCM_Unicode_LUT_2 - 1 + longcode); 2207 /* 16 in the first column of LCM_Unicode_LUT --> longcode = 1 2208 32 in the first column of LCM_Unicode_LUT --> longcode = 2 2209 48 in the first column of LCM_Unicode_LUT --> longcode = 3 */2210 }2211 2212 if (count<case_len)2213 case_component[count] = ( isupper(source_char) ? 18 : 2 ) ;2214 if (count<diacritic_len)2215 {2216 int ofs = source_char - LCM_Diacritic_Start;2217 diacritic_component[count] = (ofs>=0 ? LCM_Diacritic_LUT[ofs] : 2);2218 }2219 count++;2220 }2186 compatible with numerical comparison */ 2187 2188 *delayed_punctuation_component++ = type; 2189 *delayed_punctuation_component++ = LCM_Unicode_LUT[-1+2*source_char]; 2190 /* assumption : a punctuation character is never a 2191 double or accented letter */ 2192 } 2193 else 2194 { 2195 dststr[2*count] = type; 2196 dststr[2*count+1] = LCM_Unicode_LUT[-1+2*source_char]; 2197 if (longcode) 2198 { 2199 if (count<case_len) 2200 case_component[count] = ( isupper(source_char) ? 18 : 2 ) ; 2201 if (count<diacritic_len) 2202 diacritic_component[count] = 2; /* assumption: a double letter 2203 is never accented */ 2204 count++; 2205 2206 dststr[2*count] = type; 2207 dststr[2*count+1] = *(LCM_Unicode_LUT_2 - 1 + longcode); 2208 /* 16 in the first column of LCM_Unicode_LUT --> longcode = 1 2209 32 in the first column of LCM_Unicode_LUT --> longcode = 2 2210 48 in the first column of LCM_Unicode_LUT --> longcode = 3 */ 2211 } 2212 2213 if (count<case_len) 2214 case_component[count] = ( isupper(source_char) ? 18 : 2 ) ; 2215 if (count<diacritic_len) 2216 { 2217 int ofs = source_char - LCM_Diacritic_Start; 2218 diacritic_component[count] = (ofs>=0 ? LCM_Diacritic_LUT[ofs] : 2); 2219 } 2220 count++; 2221 } 2221 2222 } 2222 2223 } … … 2225 2226 } 2226 2227 } 2227 2228 2228 2229 /************************************************************************* 2229 2230 * LCMapStringW [KERNEL32.493] … … 2237 2238 #ifdef __WIN32OS2__ 2238 2239 ODINFUNCTION6(INT, LCMapStringW, 2239 LCID, lcid,DWORD, mapflags,LPCWSTR, srcstr,INT, srclen,LPWSTR, dststr,2240 INT, dstlen)2240 LCID, lcid,DWORD, mapflags,LPCWSTR, srcstr,INT, srclen,LPWSTR, dststr, 2241 INT, dstlen) 2241 2242 #else 2242 2243 INT WINAPI LCMapStringW( 2243 LCID lcid,DWORD mapflags,LPCWSTR srcstr,INT srclen,LPWSTR dststr,2244 INT dstlen)2244 LCID lcid,DWORD mapflags,LPCWSTR srcstr,INT srclen,LPWSTR dststr, 2245 INT dstlen) 2245 2246 #endif 2246 2247 { 2247 2248 int i; 2248 2249 2249 2250 TRACE("(0x%04lx,0x%08lx,%p,%d,%p,%d)\n", 2250 2251 lcid, mapflags, srcstr, srclen, dststr, dstlen); 2251 2252 2252 2253 if ( ((dstlen!=0) && (dststr==NULL)) || (srcstr==NULL) ) 2253 2254 { … … 2256 2257 return 0; 2257 2258 } 2258 if (srclen==-1) 2259 if (srclen==-1) 2259 2260 srclen = strlenW(srcstr)+1; 2260 2261 … … 2263 2264 * parameter the application must set the "LC_COLLATE" or "LC_ALL" 2264 2265 * environment variable prior to invoking this function. */ 2265 if (mapflags & LCMAP_SORTKEY) 2266 if (mapflags & LCMAP_SORTKEY) 2266 2267 { 2267 2268 /* Possible values of LC_COLLATE. */ … … 2320 2321 * current value is backed up so it can be restored after the 2321 2322 * last LC_COLLATE sensitive function returns. 2322 * 2323 * 2323 2324 * Even though the locale is adjusted for a minimum amount of 2324 2325 * time a race condition exists where other threads may be … … 2360 2361 { 2361 2362 LPSTR srcstr_ascii = (LPSTR)HEAP_strdupWtoA(GetProcessHeap(), 2362 0, srcstr);2363 0, srcstr); 2363 2364 ERR("wcstombs failed. The string specified (%s) may contains an " 2364 2365 "invalid character.\n", srcstr_ascii); … … 2373 2374 { 2374 2375 src_native[src_native_len - 1] = 0; 2375 ERR("wcstombs returned a string (%s) that was longer (%d bytes) " 2376 ERR("wcstombs returned a string (%s) that was longer (%d bytes) " 2376 2377 "than expected (%d bytes).\n", src_native, returned_len, 2377 2378 dst_native_len); … … 2415 2416 * not sure what those tables are. */ 2416 2417 returned_len = strxfrm(dst_native, src_native, dst_native_len) + 1; 2417 2418 2418 2419 if(returned_len > dst_native_len) 2419 2420 { 2420 2421 dst_native[dst_native_len - 1] = 0; 2421 ERR("strxfrm returned a string (%s) that was longer (%d bytes) " 2422 ERR("strxfrm returned a string (%s) that was longer (%d bytes) " 2422 2423 "than expected (%d bytes).\n", dst_native, returned_len, 2423 2424 dst_native_len); … … 2434 2435 } 2435 2436 dst_native_len = returned_len; 2436 2437 2437 2438 TRACE("dst_native = %s dst_native_len = %d\n", 2438 2439 dst_native, dst_native_len); … … 2457 2458 /* Restore LC_COLLATE now that the last LC_COLLATE sensitive 2458 2459 * function has returned. */ 2459 setlocale(LC_COLLATE, lc_collate_default); 2460 setlocale(LC_COLLATE, lc_collate_default); 2460 2461 2461 2462 if(returned_len == 0) … … 2474 2475 if(returned_len > dstlen) 2475 2476 { 2476 ERR("mbstowcs returned a string that was longer (%d chars) " 2477 ERR("mbstowcs returned a string that was longer (%d chars) " 2477 2478 "than the buffer provided (%d chars).\n", returned_len, 2478 2479 dstlen); … … 2482 2483 if(dst_native) HeapFree(GetProcessHeap(), 0, dst_native); 2483 2484 if(dststr_libc) HeapFree(GetProcessHeap(), 0, dststr_libc); 2484 return 0; 2485 return 0; 2485 2486 } 2486 2487 dstlen = returned_len; … … 2511 2512 { 2512 2513 #ifdef __WIN32OS2__ 2513 int (* _Optlink f)(int) = identity; 2514 int (* _Optlink f)(int) = identity; 2514 2515 #else 2515 int (*f)(int)=identity; 2516 int (*f)(int)=identity; 2516 2517 #endif 2517 2518 2518 2519 if (dstlen==0) 2519 return srclen; 2520 if (dstlen<srclen) 2520 return srclen; 2521 if (dstlen<srclen) 2521 2522 { 2522 2523 SetLastError(ERROR_INSUFFICIENT_BUFFER); … … 2547 2548 */ 2548 2549 static inline int OLE2NLS_EstimateMappingLength(LCID lcid, DWORD dwMapFlags, 2549 LPCSTR str, DWORD len)2550 LPCSTR str, DWORD len) 2550 2551 { 2551 2552 /* Estimate only for small strings to keep the estimation error from … … 2556 2557 2557 2558 /****************************************************************************** 2558 * CompareStringA[KERNEL32.143]2559 * CompareStringA [KERNEL32.143] 2559 2560 * Compares two strings using locale 2560 2561 * … … 2569 2570 * SORT_STRINGSORT is set. 2570 2571 * Calls SetLastError for ERROR_INVALID_FLAGS, ERROR_INVALID_PARAMETER. 2571 * 2572 * 2572 2573 * BUGS 2573 2574 * … … 2575 2576 * 2576 2577 * FIXME 2577 * 2578 * 2578 2579 * Quite inefficient. 2579 2580 */ … … 2591 2592 LPSTR sk1,sk2; 2592 2593 TRACE("%s and %s\n", 2593 debugstr_a (s1), debugstr_a (s2));2594 debugstr_a (s1), debugstr_a (s2)); 2594 2595 2595 2596 if ( (s1==NULL) || (s2==NULL) ) 2596 { 2597 { 2597 2598 ERR("(s1=%s,s2=%s): Invalid NULL string\n", s1, s2); 2598 2599 SetLastError(ERROR_INVALID_PARAMETER); … … 2605 2606 if (l1 == -1) l1 = strlen(s1); 2606 2607 if (l2 == -1) l2 = strlen(s2); 2607 2608 2608 2609 mapstring_flags = LCMAP_SORTKEY | fdwStyle ; 2609 2610 len1 = OLE2NLS_EstimateMappingLength(lcid, mapstring_flags, s1, l1); … … 2616 2617 sk2 = sk1 + len1; 2617 2618 if ( (!LCMapStringA(lcid,mapstring_flags,s1,l1,sk1,len1)) 2618 || (!LCMapStringA(lcid,mapstring_flags,s2,l2,sk2,len2)) )2619 || (!LCMapStringA(lcid,mapstring_flags,s2,l2,sk2,len2)) ) 2619 2620 { 2620 2621 ERR("Bug in LCmapStringA.\n"); … … 2638 2639 2639 2640 /****************************************************************************** 2640 * CompareStringW[KERNEL32.144]2641 * CompareStringW [KERNEL32.144] 2641 2642 * This implementation ignores the locale 2642 2643 * FIXME : Does only string sort. Should 2643 2644 * be reimplemented the same way as CompareStringA. 2644 2645 */ 2645 UINT WINAPI CompareStringW(DWORD lcid, DWORD fdwStyle, 2646 UINT WINAPI CompareStringW(DWORD lcid, DWORD fdwStyle, 2646 2647 LPCWSTR s1, DWORD l1, LPCWSTR s2,DWORD l2) 2647 2648 { 2648 int len,ret;2649 if(fdwStyle & NORM_IGNORENONSPACE)2650 FIXME("IGNORENONSPACE not supprted\n");2651 if(fdwStyle & NORM_IGNORESYMBOLS)2652 FIXME("IGNORESYMBOLS not supported\n");2653 2654 /* Is strcmp defaulting to string sort or to word sort?? */2655 /* FIXME: Handle NORM_STRINGSORT */2656 l1 = (l1==-1)?strlenW(s1):l1;2657 l2 = (l2==-1)?strlenW(s2):l2;2658 len = l1<l2 ? l1:l2;2659 ret = (fdwStyle & NORM_IGNORECASE) ? strncmpiW(s1,s2,len) : strncmpW(s1,s2,len);2660 /* not equal, return 1 or 3 */2661 if(ret!=0) {2662 /* need to translate result */2663 return ((int)ret < 0) ? 1 : 3;2664 }2665 /* same len, return 2 */2666 if(l1==l2) return 2;2667 /* the longer one is lexically greater */2668 return (l1<l2)? 1 : 3;2649 int len,ret; 2650 if(fdwStyle & NORM_IGNORENONSPACE) 2651 FIXME("IGNORENONSPACE not supprted\n"); 2652 if(fdwStyle & NORM_IGNORESYMBOLS) 2653 FIXME("IGNORESYMBOLS not supported\n"); 2654 2655 /* Is strcmp defaulting to string sort or to word sort?? */ 2656 /* FIXME: Handle NORM_STRINGSORT */ 2657 l1 = (l1==-1)?strlenW(s1):l1; 2658 l2 = (l2==-1)?strlenW(s2):l2; 2659 len = l1<l2 ? l1:l2; 2660 ret = (fdwStyle & NORM_IGNORECASE) ? strncmpiW(s1,s2,len) : strncmpW(s1,s2,len); 2661 /* not equal, return 1 or 3 */ 2662 if(ret!=0) { 2663 /* need to translate result */ 2664 return ((int)ret < 0) ? 1 : 3; 2665 } 2666 /* same len, return 2 */ 2667 if(l1==l2) return 2; 2668 /* the longer one is lexically greater */ 2669 return (l1<l2)? 1 : 3; 2669 2670 } 2670 2671 2671 2672 /****************************************************************************** 2672 * OLE_GetFormatA[Internal]2673 * OLE_GetFormatA [Internal] 2673 2674 * 2674 2675 * FIXME 2675 2676 * If datelen == 0, it should return the reguired string length. 2676 2677 * 2677 This function implements stuff for GetDateFormat() and 2678 This function implements stuff for GetDateFormat() and 2678 2679 GetTimeFormat(). 2679 2680 … … 2703 2704 '' (within a quoted string) indicates a literal ' 2704 2705 2705 These functions REQUIRE valid locale, date, and format. 2706 These functions REQUIRE valid locale, date, and format. 2706 2707 */ 2707 2708 static INT OLE_GetFormatA(LCID locale, 2708 DWORD flags,2709 DWORD tflags,2710 LPSYSTEMTIME xtime,2711 LPCSTR _format,/*in*/2712 LPSTR date,/*out*/2713 INT datelen)2709 DWORD flags, 2710 DWORD tflags, 2711 LPSYSTEMTIME xtime, 2712 LPCSTR _format, /*in*/ 2713 LPSTR date, /*out*/ 2714 INT datelen) 2714 2715 { 2715 2716 INT inpos, outpos; … … 2721 2722 2722 2723 const char * _dgfmt[] = { "%d", "%02d" }; 2723 const char ** dgfmt = _dgfmt - 1; 2724 const char ** dgfmt = _dgfmt - 1; 2724 2725 2725 2726 /* report, for debugging */ 2726 2727 TRACE("(0x%lx,0x%lx, 0x%lx, time(y=%d m=%d wd=%d d=%d,h=%d,m=%d,s=%d), fmt=%p \'%s\' , %p, len=%d)\n", 2727 locale, flags, tflags,2728 xtime->wYear,xtime->wMonth,xtime->wDayOfWeek,xtime->wDay, xtime->wHour, xtime->wMinute, xtime->wSecond,2729 _format, _format, date, datelen);2730 2728 locale, flags, tflags, 2729 xtime->wYear,xtime->wMonth,xtime->wDayOfWeek,xtime->wDay, xtime->wHour, xtime->wMinute, xtime->wSecond, 2730 _format, _format, date, datelen); 2731 2731 2732 if(datelen == 0) { 2732 2733 FIXME("datelen = 0, returning 255\n"); … … 2739 2740 type = '\0'; 2740 2741 date[0] = buf[0] = '\0'; 2741 2742 2742 2743 strcpy(format,_format); 2743 2744 2744 2745 /* alter the formatstring, while it works for all languages now in wine 2745 its possible that it fails when the time looks like ss:mm:hh as example*/ 2746 its possible that it fails when the time looks like ss:mm:hh as example*/ 2746 2747 if (tflags & (TIME_NOMINUTESORSECONDS)) 2747 2748 { if ((pos = strstr ( format, ":mm"))) … … 2754 2755 } 2755 2756 } 2756 2757 2757 2758 for (inpos = 0;; inpos++) { 2758 2759 /* TRACE("STATE inpos=%2d outpos=%2d count=%d inquote=%d type=%c buf,date = %c,%c\n", inpos, outpos, count, inquote, type, buf[inpos], date[outpos]); */ 2759 2760 if (inquote) { 2760 if (format[inpos] == '\'') {2761 if (format[inpos+1] == '\'') {2762 inpos += 1;2763 date[outpos++] = '\'';2764 } else {2765 inquote = 0;2766 continue; /* we did nothing to the output */2767 }2768 } else if (format[inpos] == '\0') {2769 date[outpos++] = '\0';2770 if (outpos > datelen) Overflow = 1;2771 break;2772 } else {2773 date[outpos++] = format[inpos];2774 if (outpos > datelen) {2775 Overflow = 1;2776 date[outpos-1] = '\0'; /* this is the last place where2777 it's safe to write */2778 break;2779 }2780 }2761 if (format[inpos] == '\'') { 2762 if (format[inpos+1] == '\'') { 2763 inpos += 1; 2764 date[outpos++] = '\''; 2765 } else { 2766 inquote = 0; 2767 continue; /* we did nothing to the output */ 2768 } 2769 } else if (format[inpos] == '\0') { 2770 date[outpos++] = '\0'; 2771 if (outpos > datelen) Overflow = 1; 2772 break; 2773 } else { 2774 date[outpos++] = format[inpos]; 2775 if (outpos > datelen) { 2776 Overflow = 1; 2777 date[outpos-1] = '\0'; /* this is the last place where 2778 it's safe to write */ 2779 break; 2780 } 2781 } 2781 2782 } else if ( (count && (format[inpos] != type)) 2782 || count == 42783 || (count == 2 && strchr("ghHmst", type)) ) {2784 if (type == 'h' && (tflags & TIME_FORCE24HOURFORMAT)) type= 'H';2785 if (type == 'd') {2786 if (count == 4) {2787 GetLocaleInfoA(locale,2788 LOCALE_SDAYNAME12789 + (xtime->wDayOfWeek+6)%7,2790 buf, sizeof(buf));2791 } else if (count == 3) {2792 GetLocaleInfoA(locale, 2793 LOCALE_SABBREVDAYNAME1 2794 + (xtime->wDayOfWeek+6)%7,2795 buf, sizeof(buf));2796 } else {2797 sprintf(buf, dgfmt[count], xtime->wDay);2798 }2799 } else if (type == 'M') {2800 if (count == 3) {2801 GetLocaleInfoA(locale, 2802 LOCALE_SABBREVMONTHNAME12803 + xtime->wMonth - 1,2804 buf, sizeof(buf));2805 } else if (count == 4) {2806 GetLocaleInfoA(locale,2807 LOCALE_SMONTHNAME12808 + xtime->wMonth - 1,2809 buf, sizeof(buf));2810 } else {2811 sprintf(buf, dgfmt[count], xtime->wMonth);2812 }2813 } else if (type == 'y') {2814 if (count == 4) {2815 sprintf(buf, "%d", xtime->wYear);2816 } else if (count == 3) {2817 strcpy(buf, "yyy");2818 WARN("unknown format, c=%c, n=%d\n", type, count);2819 } else {2820 sprintf(buf, dgfmt[count], xtime->wYear % 100);2821 }2822 } else if (type == 'g') {2823 if (count == 2) {2824 FIXME("LOCALE_ICALENDARTYPE unimp.\n");2825 strcpy(buf, "AD");2826 } else {2827 strcpy(buf, "g");2828 WARN("unknown format, c=%c, n=%d\n", type, count);2829 }2830 } else if (type == 'h') {2831 /* gives us hours 1:00 -- 12:00 */2832 sprintf(buf, dgfmt[count], (xtime->wHour-1)%12 +1);2833 } else if (type == 'H') {2834 /* 24-hour time */2835 sprintf(buf, dgfmt[count], xtime->wHour);2836 } else if ( type == 'm') {2837 sprintf(buf, dgfmt[count], xtime->wMinute);2838 } else if ( type == 's') {2839 sprintf(buf, dgfmt[count], xtime->wSecond);2840 } else if (type == 't') {2783 || count == 4 2784 || (count == 2 && strchr("ghHmst", type)) ) { 2785 if (type == 'h' && (tflags & TIME_FORCE24HOURFORMAT)) type= 'H'; 2786 if (type == 'd') { 2787 if (count == 4) { 2788 GetLocaleInfoA(locale, 2789 LOCALE_SDAYNAME1 2790 + (xtime->wDayOfWeek+6)%7, 2791 buf, sizeof(buf)); 2792 } else if (count == 3) { 2793 GetLocaleInfoA(locale, 2794 LOCALE_SABBREVDAYNAME1 2795 + (xtime->wDayOfWeek+6)%7, 2796 buf, sizeof(buf)); 2797 } else { 2798 sprintf(buf, dgfmt[count], xtime->wDay); 2799 } 2800 } else if (type == 'M') { 2801 if (count == 3) { 2802 GetLocaleInfoA(locale, 2803 LOCALE_SABBREVMONTHNAME1 2804 + xtime->wMonth - 1, 2805 buf, sizeof(buf)); 2806 } else if (count == 4) { 2807 GetLocaleInfoA(locale, 2808 LOCALE_SMONTHNAME1 2809 + xtime->wMonth - 1, 2810 buf, sizeof(buf)); 2811 } else { 2812 sprintf(buf, dgfmt[count], xtime->wMonth); 2813 } 2814 } else if (type == 'y') { 2815 if (count == 4) { 2816 sprintf(buf, "%d", xtime->wYear); 2817 } else if (count == 3) { 2818 strcpy(buf, "yyy"); 2819 WARN("unknown format, c=%c, n=%d\n", type, count); 2820 } else { 2821 sprintf(buf, dgfmt[count], xtime->wYear % 100); 2822 } 2823 } else if (type == 'g') { 2824 if (count == 2) { 2825 FIXME("LOCALE_ICALENDARTYPE unimp.\n"); 2826 strcpy(buf, "AD"); 2827 } else { 2828 strcpy(buf, "g"); 2829 WARN("unknown format, c=%c, n=%d\n", type, count); 2830 } 2831 } else if (type == 'h') { 2832 /* gives us hours 1:00 -- 12:00 */ 2833 sprintf(buf, dgfmt[count], (xtime->wHour-1)%12 +1); 2834 } else if (type == 'H') { 2835 /* 24-hour time */ 2836 sprintf(buf, dgfmt[count], xtime->wHour); 2837 } else if ( type == 'm') { 2838 sprintf(buf, dgfmt[count], xtime->wMinute); 2839 } else if ( type == 's') { 2840 sprintf(buf, dgfmt[count], xtime->wSecond); 2841 } else if (type == 't') { 2841 2842 if ((tflags & TIME_NOTIMEMARKER)) 2842 2843 buf[0]='\0'; 2843 2844 else if (count == 1) { 2844 sprintf(buf, "%c", (xtime->wHour < 12) ? 'A' : 'P');2845 sprintf(buf, "%c", (xtime->wHour < 12) ? 'A' : 'P'); 2845 2846 } else if (count == 2) { 2846 2847 /* sprintf(buf, "%s", (xtime->wHour < 12) ? "AM" : "PM"); */ 2847 2848 GetLocaleInfoA(locale, 2848 (xtime->wHour<12) 2849 (xtime->wHour<12) 2849 2850 ? LOCALE_S1159 : LOCALE_S2359, 2850 2851 buf, sizeof(buf)); 2851 2852 } 2852 };2853 2854 /* we need to check the next char in the format string 2855 again, no matter what happened */2856 inpos--;2857 2858 /* add the contents of buf to the output */2859 buflen = strlen(buf);2860 if (outpos + buflen < datelen) {2861 date[outpos] = '\0'; /* for strcat to hook onto */2862 strcat(date, buf);2863 outpos += buflen;2864 } else {2865 date[outpos] = '\0';2866 strncat(date, buf, datelen - outpos);2867 date[datelen - 1] = '\0';2868 SetLastError(ERROR_INSUFFICIENT_BUFFER);2869 WARN("insufficient buffer\n");2870 return 0;2871 }2872 2873 /* reset the variables we used to keep track of this item */2874 count = 0;2875 type = '\0';2876 } else if (format[inpos] == '\0') {2877 /* we can't check for this at the loop-head, because2878 that breaks the printing of the last format-item */2879 date[outpos] = '\0';2880 break;2853 }; 2854 2855 /* we need to check the next char in the format string 2856 again, no matter what happened */ 2857 inpos--; 2858 2859 /* add the contents of buf to the output */ 2860 buflen = strlen(buf); 2861 if (outpos + buflen < datelen) { 2862 date[outpos] = '\0'; /* for strcat to hook onto */ 2863 strcat(date, buf); 2864 outpos += buflen; 2865 } else { 2866 date[outpos] = '\0'; 2867 strncat(date, buf, datelen - outpos); 2868 date[datelen - 1] = '\0'; 2869 SetLastError(ERROR_INSUFFICIENT_BUFFER); 2870 WARN("insufficient buffer\n"); 2871 return 0; 2872 } 2873 2874 /* reset the variables we used to keep track of this item */ 2875 count = 0; 2876 type = '\0'; 2877 } else if (format[inpos] == '\0') { 2878 /* we can't check for this at the loop-head, because 2879 that breaks the printing of the last format-item */ 2880 date[outpos] = '\0'; 2881 break; 2881 2882 } else if (count) { 2882 /* continuing a code for an item */2883 count +=1;2884 continue;2885 } else if (strchr("hHmstyMdg", format[inpos])) {2886 type = format[inpos];2887 count = 1;2888 continue;2889 } else if (format[inpos] == '\'') {2890 inquote = 1;2891 continue;2883 /* continuing a code for an item */ 2884 count +=1; 2885 continue; 2886 } else if (strchr("hHmstyMdg", format[inpos])) { 2887 type = format[inpos]; 2888 count = 1; 2889 continue; 2890 } else if (format[inpos] == '\'') { 2891 inquote = 1; 2892 continue; 2892 2893 } else { 2893 date[outpos++] = format[inpos];2894 }2894 date[outpos++] = format[inpos]; 2895 } 2895 2896 /* now deal with a possible buffer overflow */ 2896 2897 if (outpos >= datelen) { … … 2900 2901 } 2901 2902 } 2902 2903 2903 2904 if (Overflow) { 2904 2905 SetLastError(ERROR_INSUFFICIENT_BUFFER); … … 2910 2911 if (outpos > datelen-1) outpos = datelen-1; 2911 2912 date[outpos] = '\0'; 2912 2913 2913 2914 TRACE("returns string '%s', len %d\n", date, outpos); 2914 2915 return outpos; … … 2919 2920 */ 2920 2921 static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags, 2921 LPSYSTEMTIME xtime,2922 LPCWSTR format,2923 LPWSTR output, INT outlen)2922 LPSYSTEMTIME xtime, 2923 LPCWSTR format, 2924 LPWSTR output, INT outlen) 2924 2925 { 2925 2926 INT inpos, outpos; … … 2940 2941 /* make a debug report */ 2941 2942 TRACE("args: 0x%lx, 0x%lx, 0x%lx, time(d=%d,h=%d,m=%d,s=%d), fmt:%s (at %p), " 2942 "%p with max len %d\n",2943 locale, flags, tflags,2944 xtime->wDay, xtime->wHour, xtime->wMinute, xtime->wSecond,2945 debugstr_w(format), format, output, outlen);2946 2943 "%p with max len %d\n", 2944 locale, flags, tflags, 2945 xtime->wDay, xtime->wHour, xtime->wMinute, xtime->wSecond, 2946 debugstr_w(format), format, output, outlen); 2947 2947 2948 if(outlen == 0) { 2948 2949 FIXME("outlen = 0, returning 255\n"); … … 2956 2957 /* this is really just a sanity check */ 2957 2958 output[0] = buf[0] = 0; 2958 2959 2959 2960 /* this loop is the core of the function */ 2960 2961 for (inpos = 0; /* we have several break points */ ; inpos++) { 2961 2962 if (inquote) { 2962 if (format[inpos] == (WCHAR) '\'') {2963 if (format[inpos+1] == '\'') {2964 inpos++;2965 output[outpos++] = '\'';2966 } else {2967 inquote = 0;2968 continue;2969 }2970 } else if (format[inpos] == 0) {2971 output[outpos++] = 0;2972 if (outpos > outlen) Overflow = 1;2973 break; /* normal exit (within a quote) */2974 } else {2975 output[outpos++] = format[inpos]; /* copy input */2976 if (outpos > outlen) {2977 Overflow = 1;2978 output[outpos-1] = 0; 2979 break;2980 }2981 }2963 if (format[inpos] == (WCHAR) '\'') { 2964 if (format[inpos+1] == '\'') { 2965 inpos++; 2966 output[outpos++] = '\''; 2967 } else { 2968 inquote = 0; 2969 continue; 2970 } 2971 } else if (format[inpos] == 0) { 2972 output[outpos++] = 0; 2973 if (outpos > outlen) Overflow = 1; 2974 break; /* normal exit (within a quote) */ 2975 } else { 2976 output[outpos++] = format[inpos]; /* copy input */ 2977 if (outpos > outlen) { 2978 Overflow = 1; 2979 output[outpos-1] = 0; 2980 break; 2981 } 2982 } 2982 2983 } else if ( (count && (format[inpos] != type)) 2983 || ( (count==4 && type =='y') ||2984 (count==4 && type =='M') ||2985 (count==4 && type =='d') ||2986 (count==2 && type =='g') ||2987 (count==2 && type =='h') ||2988 (count==2 && type =='H') ||2989 (count==2 && type =='m') ||2990 (count==2 && type =='s') ||2991 (count==2 && type =='t') ) ) {2984 || ( (count==4 && type =='y') || 2985 (count==4 && type =='M') || 2986 (count==4 && type =='d') || 2987 (count==2 && type =='g') || 2988 (count==2 && type =='h') || 2989 (count==2 && type =='H') || 2990 (count==2 && type =='m') || 2991 (count==2 && type =='s') || 2992 (count==2 && type =='t') ) ) { 2992 2993 switch(type) 2993 2994 { 2994 2995 case 'd': 2995 if (count == 4) {2996 GetLocaleInfoW(locale,2997 LOCALE_SDAYNAME1 + (xtime->wDayOfWeek +6)%7,2998 buf, sizeof(buf)/sizeof(WCHAR) );2999 } else if (count == 3) {3000 GetLocaleInfoW(locale,3001 LOCALE_SABBREVDAYNAME1 +3002 (xtime->wDayOfWeek +6)%7,3003 buf, sizeof(buf)/sizeof(WCHAR) );3004 } else {2996 if (count == 4) { 2997 GetLocaleInfoW(locale, 2998 LOCALE_SDAYNAME1 + (xtime->wDayOfWeek +6)%7, 2999 buf, sizeof(buf)/sizeof(WCHAR) ); 3000 } else if (count == 3) { 3001 GetLocaleInfoW(locale, 3002 LOCALE_SABBREVDAYNAME1 + 3003 (xtime->wDayOfWeek +6)%7, 3004 buf, sizeof(buf)/sizeof(WCHAR) ); 3005 } else { 3005 3006 sprintf( tmp, "%.*d", count, xtime->wDay ); 3006 3007 MultiByteToWideChar( CP_ACP, 0, tmp, -1, buf, sizeof(buf)/sizeof(WCHAR) ); 3007 }3008 } 3008 3009 break; 3009 3010 3010 3011 case 'M': 3011 if (count == 4) {3012 GetLocaleInfoW(locale, LOCALE_SMONTHNAME1 +3013 xtime->wMonth -1, buf,3014 sizeof(buf)/sizeof(WCHAR) );3015 } else if (count == 3) {3016 GetLocaleInfoW(locale, LOCALE_SABBREVMONTHNAME1 +3017 xtime->wMonth -1, buf,3018 sizeof(buf)/sizeof(WCHAR) );3019 } else {3012 if (count == 4) { 3013 GetLocaleInfoW(locale, LOCALE_SMONTHNAME1 + 3014 xtime->wMonth -1, buf, 3015 sizeof(buf)/sizeof(WCHAR) ); 3016 } else if (count == 3) { 3017 GetLocaleInfoW(locale, LOCALE_SABBREVMONTHNAME1 + 3018 xtime->wMonth -1, buf, 3019 sizeof(buf)/sizeof(WCHAR) ); 3020 } else { 3020 3021 sprintf( tmp, "%.*d", count, xtime->wMonth ); 3021 3022 MultiByteToWideChar( CP_ACP, 0, tmp, -1, buf, sizeof(buf)/sizeof(WCHAR) ); 3022 }3023 } 3023 3024 break; 3024 3025 case 'y': 3025 if (count == 4) {3026 if (count == 4) { 3026 3027 sprintf( tmp, "%d", xtime->wYear ); 3027 } else if (count == 3) {3028 } else if (count == 3) { 3028 3029 strcpy( tmp, "yyy" ); 3029 } else {3030 } else { 3030 3031 sprintf( tmp, "%.*d", count, xtime->wYear % 100 ); 3031 }3032 } 3032 3033 MultiByteToWideChar( CP_ACP, 0, tmp, -1, buf, sizeof(buf)/sizeof(WCHAR) ); 3033 3034 break; 3034 3035 3035 3036 case 'g': 3036 if (count == 2) {3037 FIXME("LOCALE_ICALENDARTYPE unimplemented\n");3037 if (count == 2) { 3038 FIXME("LOCALE_ICALENDARTYPE unimplemented\n"); 3038 3039 strcpy( tmp, "AD" ); 3039 } else {3040 /* Win API sez we copy it verbatim */3040 } else { 3041 /* Win API sez we copy it verbatim */ 3041 3042 strcpy( tmp, "g" ); 3042 }3043 } 3043 3044 MultiByteToWideChar( CP_ACP, 0, tmp, -1, buf, sizeof(buf)/sizeof(WCHAR) ); 3044 3045 break; … … 3066 3067 3067 3068 case 't': 3068 GetLocaleInfoW(locale, (xtime->wHour < 12) ?3069 LOCALE_S1159 : LOCALE_S2359,3070 buf, sizeof(buf) );3071 if (count == 1) {3072 buf[1] = 0;3073 }3069 GetLocaleInfoW(locale, (xtime->wHour < 12) ? 3070 LOCALE_S1159 : LOCALE_S2359, 3071 buf, sizeof(buf) ); 3072 if (count == 1) { 3073 buf[1] = 0; 3074 } 3074 3075 break; 3075 3076 } 3076 3077 3077 /* no matter what happened, we need to check this next 3078 character the next time we loop through */3079 inpos--;3080 3081 /* cat buf onto the output */3082 outlen = strlenW(buf);3083 if (outpos + buflen < outlen) {3078 /* no matter what happened, we need to check this next 3079 character the next time we loop through */ 3080 inpos--; 3081 3082 /* cat buf onto the output */ 3083 outlen = strlenW(buf); 3084 if (outpos + buflen < outlen) { 3084 3085 strcpyW( output + outpos, buf ); 3085 outpos += buflen;3086 } else {3086 outpos += buflen; 3087 } else { 3087 3088 lstrcpynW( output + outpos, buf, outlen - outpos ); 3088 Overflow = 1;3089 break; /* Abnormal exit */3090 }3091 3092 /* reset the variables we used this time */3093 count = 0;3094 type = '\0';3089 Overflow = 1; 3090 break; /* Abnormal exit */ 3091 } 3092 3093 /* reset the variables we used this time */ 3094 count = 0; 3095 type = '\0'; 3095 3096 } else if (format[inpos] == 0) { 3096 /* we can't check for this at the beginning, because that 3097 would keep us from printing a format spec that ended the 3098 string */3099 output[outpos] = 0;3100 break; /* NORMAL EXIT */3097 /* we can't check for this at the beginning, because that 3098 would keep us from printing a format spec that ended the 3099 string */ 3100 output[outpos] = 0; 3101 break; /* NORMAL EXIT */ 3101 3102 } else if (count) { 3102 /* how we keep track of the middle of a format spec */3103 count++;3104 continue;3103 /* how we keep track of the middle of a format spec */ 3104 count++; 3105 continue; 3105 3106 } else if ( (datevars && (format[inpos]=='d' || 3106 format[inpos]=='M' ||3107 format[inpos]=='y' ||3108 format[inpos]=='g') ) ||3109 (timevars && (format[inpos]=='H' ||3110 format[inpos]=='h' ||3111 format[inpos]=='m' ||3112 format[inpos]=='s' ||3113 format[inpos]=='t') ) ) {3114 type = format[inpos];3115 count = 1;3116 continue;3107 format[inpos]=='M' || 3108 format[inpos]=='y' || 3109 format[inpos]=='g') ) || 3110 (timevars && (format[inpos]=='H' || 3111 format[inpos]=='h' || 3112 format[inpos]=='m' || 3113 format[inpos]=='s' || 3114 format[inpos]=='t') ) ) { 3115 type = format[inpos]; 3116 count = 1; 3117 continue; 3117 3118 } else if (format[inpos] == '\'') { 3118 inquote = 1;3119 continue;3119 inquote = 1; 3120 continue; 3120 3121 } else { 3121 /* unquoted literals */3122 output[outpos++] = format[inpos];3122 /* unquoted literals */ 3123 output[outpos++] = format[inpos]; 3123 3124 } 3124 3125 } … … 3135 3136 3136 3137 TRACE(" returning %s\n", debugstr_w(output)); 3137 3138 3138 3139 return (!Overflow) ? outlen : 0; 3139 3140 3140 3141 } 3141 3142 3142 3143 3143 3144 /****************************************************************************** 3144 * GetDateFormatA[KERNEL32.310]3145 * GetDateFormatA [KERNEL32.310] 3145 3146 * Makes an ASCII string of the date 3146 3147 * … … 3164 3165 */ 3165 3166 INT WINAPI GetDateFormatA(LCID locale,DWORD flags, 3166 LPSYSTEMTIME xtime,3167 LPCSTR format, LPSTR date,INT datelen) 3168 { 3169 3167 LPSYSTEMTIME xtime, 3168 LPCSTR format, LPSTR date,INT datelen) 3169 { 3170 3170 3171 char format_buf[40]; 3171 3172 LPCSTR thisformat; … … 3178 3179 3179 3180 TRACE("(0x%04lx,0x%08lx,%p,%s,%p,%d)\n", 3180 locale,flags,xtime,format,date,datelen);3181 3181 locale,flags,xtime,format,date,datelen); 3182 3182 3183 if (!locale) { 3183 3184 locale = LOCALE_SYSTEM_DEFAULT; 3184 3185 }; 3185 3186 3186 3187 if (locale == LOCALE_SYSTEM_DEFAULT) { 3187 3188 thislocale = GetSystemDefaultLCID(); … … 3200 3201 /*FIXME: SystemTimeToFileTime doesn't yet do that ckeck*/ 3201 3202 if(!res) 3202 {3203 SetLastError(ERROR_INVALID_PARAMETER);3204 return 0;3205 }3206 FileTimeToSystemTime(&ft,&t); 3207 3203 { 3204 SetLastError(ERROR_INVALID_PARAMETER); 3205 return 0; 3206 } 3207 FileTimeToSystemTime(&ft,&t); 3208 3208 3209 }; 3209 3210 thistime = &t; 3210 3211 3211 3212 if (format == NULL) { 3212 GetLocaleInfoA(thislocale, ((flags&DATE_LONGDATE) 3213 ? LOCALE_SLONGDATE3214 : LOCALE_SSHORTDATE),3215 format_buf, sizeof(format_buf));3213 GetLocaleInfoA(thislocale, ((flags&DATE_LONGDATE) 3214 ? LOCALE_SLONGDATE 3215 : LOCALE_SSHORTDATE), 3216 format_buf, sizeof(format_buf)); 3216 3217 thisformat = format_buf; 3217 3218 } else { … … 3219 3220 }; 3220 3221 3221 3222 ret = OLE_GetFormatA(thislocale, flags, 0, thistime, thisformat, 3223 date, datelen);3224 3222 3223 ret = OLE_GetFormatA(thislocale, flags, 0, thistime, thisformat, 3224 date, datelen); 3225 3225 3226 3226 3227 TRACE( 3227 "GetDateFormatA() returning %d, with data=%s\n",3228 ret, date);3228 "GetDateFormatA() returning %d, with data=%s\n", 3229 ret, date); 3229 3230 return ret; 3230 3231 } 3231 3232 3232 3233 /****************************************************************************** 3233 * GetDateFormatW[KERNEL32.311]3234 * GetDateFormatW [KERNEL32.311] 3234 3235 * Makes a Unicode string of the date 3235 3236 * … … 3239 3240 */ 3240 3241 INT WINAPI GetDateFormatW(LCID locale,DWORD flags, 3241 LPSYSTEMTIME xtime,3242 LPCWSTR format,3243 LPWSTR date, INT datelen)3242 LPSYSTEMTIME xtime, 3243 LPCWSTR format, 3244 LPWSTR date, INT datelen) 3244 3245 { 3245 3246 // convert "format" on passing in into ASCII 3246 3247 LPSTR pszAsciiFormat = UnicodeToAsciiString((LPWSTR) format); 3247 3248 LPSTR pszAsciiDate = (char *)alloca(datelen); 3248 3249 3249 3250 TRACE("Kernel32-ole2nls: GetDateFormatW(0x%04lx,0x%08lx,%p,%s,%p,%d) not yet complete\n", 3250 locale,flags,xtime,pszAsciiFormat,date,datelen);3251 locale,flags,xtime,pszAsciiFormat,date,datelen); 3251 3252 3252 3253 // call ASCII variant … … 3257 3258 pszAsciiDate, 3258 3259 datelen); // is in "characters", not bytes 3259 3260 3260 3261 FreeAsciiString(pszAsciiFormat); 3261 3262 3262 3263 // convert "date" on returning to UNICODE 3263 3264 if (datelen != 0) … … 3266 3267 lstrcpynAtoW(date, pszAsciiDate, rc); 3267 3268 } 3268 3269 3269 3270 return rc; 3270 3271 3271 3272 #if PH_OFF 3272 3273 unsigned short datearr[] = {'1','9','9','4','-','1','-','1',0}; 3273 3274 3274 FIXME("STUB (should call OLE_GetFormatW)\n"); 3275 FIXME("STUB (should call OLE_GetFormatW)\n"); 3275 3276 lstrcpynW(date, datearr, datelen); 3276 3277 return ( datelen < 9) ? datelen : 9; … … 3279 3280 3280 3281 /************************************************************************** 3281 * EnumDateFormatsA (KERNEL32.198)3282 * EnumDateFormatsA (KERNEL32.198) 3282 3283 */ 3283 3284 BOOL WINAPI EnumDateFormatsA( 3284 3285 DATEFMT_ENUMPROCA lpDateFmtEnumProc, LCID Locale, DWORD dwFlags) 3285 3286 { 3286 LCID Loc = GetUserDefaultLCID(); 3287 LCID Loc = GetUserDefaultLCID(); 3287 3288 if(!lpDateFmtEnumProc) 3288 3289 { … … 3299 3300 { 3300 3301 case DATE_SHORTDATE: 3301 if(!(*lpDateFmtEnumProc)("dd.MM.yy")) return TRUE;3302 if(!(*lpDateFmtEnumProc)("d.M.yyyy")) return TRUE;3303 if(!(*lpDateFmtEnumProc)("d.MM.yy")) return TRUE;3304 if(!(*lpDateFmtEnumProc)("d.M.yy")) return TRUE;3305 return TRUE;3302 if(!(*lpDateFmtEnumProc)("dd.MM.yy")) return TRUE; 3303 if(!(*lpDateFmtEnumProc)("d.M.yyyy")) return TRUE; 3304 if(!(*lpDateFmtEnumProc)("d.MM.yy")) return TRUE; 3305 if(!(*lpDateFmtEnumProc)("d.M.yy")) return TRUE; 3306 return TRUE; 3306 3307 case DATE_LONGDATE: 3307 3308 if(!(*lpDateFmtEnumProc)("dddd,d. MMMM yyyy")) return TRUE; 3308 3309 if(!(*lpDateFmtEnumProc)("d. MMMM yyyy")) return TRUE; 3309 3310 if(!(*lpDateFmtEnumProc)("d. MMM yyyy")) return TRUE; 3310 return TRUE;3311 return TRUE; 3311 3312 default: 3312 FIXME("Unknown date format (%ld)\n", dwFlags); 3313 SetLastError(ERROR_INVALID_PARAMETER);3314 return FALSE;3313 FIXME("Unknown date format (%ld)\n", dwFlags); 3314 SetLastError(ERROR_INVALID_PARAMETER); 3315 return FALSE; 3315 3316 } 3316 } 3317 } 3317 3318 3318 3319 case 0x0000040c: /* (Loc,"fr_FR") */ … … 3321 3322 { 3322 3323 case DATE_SHORTDATE: 3323 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE;3324 if(!(*lpDateFmtEnumProc)("dd.MM.yy")) return TRUE;3325 if(!(*lpDateFmtEnumProc)("dd-MM-yy")) return TRUE;3326 if(!(*lpDateFmtEnumProc)("dd/MM/yyyy")) return TRUE;3327 return TRUE;3324 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE; 3325 if(!(*lpDateFmtEnumProc)("dd.MM.yy")) return TRUE; 3326 if(!(*lpDateFmtEnumProc)("dd-MM-yy")) return TRUE; 3327 if(!(*lpDateFmtEnumProc)("dd/MM/yyyy")) return TRUE; 3328 return TRUE; 3328 3329 case DATE_LONGDATE: 3329 3330 if(!(*lpDateFmtEnumProc)("dddd d MMMM yyyy")) return TRUE; 3330 3331 if(!(*lpDateFmtEnumProc)("d MMM yy")) return TRUE; 3331 3332 if(!(*lpDateFmtEnumProc)("d MMMM yyyy")) return TRUE; 3332 return TRUE;3333 return TRUE; 3333 3334 default: 3334 FIXME("Unknown date format (%ld)\n", dwFlags); 3335 SetLastError(ERROR_INVALID_PARAMETER);3336 return FALSE;3335 FIXME("Unknown date format (%ld)\n", dwFlags); 3336 SetLastError(ERROR_INVALID_PARAMETER); 3337 return FALSE; 3337 3338 } 3338 3339 } … … 3343 3344 { 3344 3345 case DATE_SHORTDATE: 3345 if(!(*lpDateFmtEnumProc)("yy-MM-dd")) return TRUE;3346 if(!(*lpDateFmtEnumProc)("dd-MM-yy")) return TRUE;3347 if(!(*lpDateFmtEnumProc)("yy MM dd")) return TRUE;3348 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE;3349 return TRUE;3346 if(!(*lpDateFmtEnumProc)("yy-MM-dd")) return TRUE; 3347 if(!(*lpDateFmtEnumProc)("dd-MM-yy")) return TRUE; 3348 if(!(*lpDateFmtEnumProc)("yy MM dd")) return TRUE; 3349 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE; 3350 return TRUE; 3350 3351 case DATE_LONGDATE: 3351 3352 if(!(*lpDateFmtEnumProc)("d MMMM, yyyy")) return TRUE; 3352 3353 if(!(*lpDateFmtEnumProc)("d MMM yyyy")) return TRUE; 3353 return TRUE;3354 return TRUE; 3354 3355 default: 3355 FIXME("Unknown date format (%ld)\n", dwFlags); 3356 SetLastError(ERROR_INVALID_PARAMETER);3357 return FALSE;3356 FIXME("Unknown date format (%ld)\n", dwFlags); 3357 SetLastError(ERROR_INVALID_PARAMETER); 3358 return FALSE; 3358 3359 } 3359 3360 } 3360 3361 3361 case 0x00000809: /* (Loc,"en_UK") */ 3362 { 3362 case 0x00000809: /* (Loc,"en_UK") */ 3363 { 3363 3364 switch(dwFlags) 3364 3365 { 3365 3366 case DATE_SHORTDATE: 3366 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE;3367 if(!(*lpDateFmtEnumProc)("dd/MM/yyyy")) return TRUE;3368 if(!(*lpDateFmtEnumProc)("d/M/yy")) return TRUE;3369 if(!(*lpDateFmtEnumProc)("d.M.yy")) return TRUE;3370 return TRUE;3367 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE; 3368 if(!(*lpDateFmtEnumProc)("dd/MM/yyyy")) return TRUE; 3369 if(!(*lpDateFmtEnumProc)("d/M/yy")) return TRUE; 3370 if(!(*lpDateFmtEnumProc)("d.M.yy")) return TRUE; 3371 return TRUE; 3371 3372 case DATE_LONGDATE: 3372 3373 if(!(*lpDateFmtEnumProc)("dd MMMM yyyy")) return TRUE; 3373 3374 if(!(*lpDateFmtEnumProc)("d MMMM yyyy")) return TRUE; 3374 return TRUE;3375 return TRUE; 3375 3376 default: 3376 FIXME("Unknown date format (%ld)\n", dwFlags); 3377 SetLastError(ERROR_INVALID_PARAMETER);3378 return FALSE;3377 FIXME("Unknown date format (%ld)\n", dwFlags); 3378 SetLastError(ERROR_INVALID_PARAMETER); 3379 return FALSE; 3379 3380 } 3380 3381 } 3381 3382 3382 case 0x00000c09: /* (Loc,"en_AU") */ 3383 { 3383 case 0x00000c09: /* (Loc,"en_AU") */ 3384 { 3384 3385 switch(dwFlags) 3385 3386 { 3386 3387 case DATE_SHORTDATE: 3387 if(!(*lpDateFmtEnumProc)("d/MM/yy")) return TRUE;3388 if(!(*lpDateFmtEnumProc)("d/M/yy")) return TRUE;3389 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE;3390 return TRUE;3388 if(!(*lpDateFmtEnumProc)("d/MM/yy")) return TRUE; 3389 if(!(*lpDateFmtEnumProc)("d/M/yy")) return TRUE; 3390 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE; 3391 return TRUE; 3391 3392 case DATE_LONGDATE: 3392 3393 if(!(*lpDateFmtEnumProc)("dddd,d MMMM yyyy")) return TRUE; 3393 3394 if(!(*lpDateFmtEnumProc)("d MMMM yyyy")) return TRUE; 3394 return TRUE;3395 return TRUE; 3395 3396 default: 3396 FIXME("Unknown date format (%ld)\n", dwFlags); 3397 SetLastError(ERROR_INVALID_PARAMETER);3398 return FALSE;3397 FIXME("Unknown date format (%ld)\n", dwFlags); 3398 SetLastError(ERROR_INVALID_PARAMETER); 3399 return FALSE; 3399 3400 } 3400 3401 } 3401 3402 3402 case 0x00001009: /* (Loc,"en_CA") */ 3403 { 3403 case 0x00001009: /* (Loc,"en_CA") */ 3404 { 3404 3405 switch(dwFlags) 3405 3406 { 3406 3407 case DATE_SHORTDATE: 3407 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE;3408 if(!(*lpDateFmtEnumProc)("d/M/yy")) return TRUE;3409 if(!(*lpDateFmtEnumProc)("yy-MM-dd")) return TRUE;3410 if(!(*lpDateFmtEnumProc)("M/dd/yy")) return TRUE;3411 return TRUE;3408 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE; 3409 if(!(*lpDateFmtEnumProc)("d/M/yy")) return TRUE; 3410 if(!(*lpDateFmtEnumProc)("yy-MM-dd")) return TRUE; 3411 if(!(*lpDateFmtEnumProc)("M/dd/yy")) return TRUE; 3412 return TRUE; 3412 3413 case DATE_LONGDATE: 3413 3414 if(!(*lpDateFmtEnumProc)("d-MMM-yy")) return TRUE; 3414 3415 if(!(*lpDateFmtEnumProc)("MMMM d, yyyy")) return TRUE; 3415 return TRUE;3416 return TRUE; 3416 3417 default: 3417 FIXME("Unknown date format (%ld)\n", dwFlags); 3418 SetLastError(ERROR_INVALID_PARAMETER);3419 return FALSE;3418 FIXME("Unknown date format (%ld)\n", dwFlags); 3419 SetLastError(ERROR_INVALID_PARAMETER); 3420 return FALSE; 3420 3421 } 3421 3422 } 3422 3423 3423 case 0x00001409: /* (Loc,"en_NZ") */ 3424 { 3424 case 0x00001409: /* (Loc,"en_NZ") */ 3425 { 3425 3426 switch(dwFlags) 3426 3427 { 3427 3428 case DATE_SHORTDATE: 3428 if(!(*lpDateFmtEnumProc)("d/MM/yy")) return TRUE;3429 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE;3430 if(!(*lpDateFmtEnumProc)("d.MM.yy")) return TRUE;3431 return TRUE;3429 if(!(*lpDateFmtEnumProc)("d/MM/yy")) return TRUE; 3430 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE; 3431 if(!(*lpDateFmtEnumProc)("d.MM.yy")) return TRUE; 3432 return TRUE; 3432 3433 case DATE_LONGDATE: 3433 3434 if(!(*lpDateFmtEnumProc)("d MMMM yyyy")) return TRUE; 3434 3435 if(!(*lpDateFmtEnumProc)("dddd, d MMMM yyyy")) return TRUE; 3435 return TRUE;3436 return TRUE; 3436 3437 default: 3437 FIXME("Unknown date format (%ld)\n", dwFlags); 3438 SetLastError(ERROR_INVALID_PARAMETER);3439 return FALSE;3438 FIXME("Unknown date format (%ld)\n", dwFlags); 3439 SetLastError(ERROR_INVALID_PARAMETER); 3440 return FALSE; 3440 3441 } 3441 3442 } 3442 3443 3443 case 0x00001809: /* (Loc,"en_IE") */ 3444 { 3444 case 0x00001809: /* (Loc,"en_IE") */ 3445 { 3445 3446 switch(dwFlags) 3446 3447 { 3447 3448 case DATE_SHORTDATE: 3448 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE;3449 if(!(*lpDateFmtEnumProc)("d/M/yy")) return TRUE;3450 if(!(*lpDateFmtEnumProc)("d.M.yy")) return TRUE;3451 return TRUE;3449 if(!(*lpDateFmtEnumProc)("dd/MM/yy")) return TRUE; 3450 if(!(*lpDateFmtEnumProc)("d/M/yy")) return TRUE; 3451 if(!(*lpDateFmtEnumProc)("d.M.yy")) return TRUE; 3452 return TRUE; 3452 3453 case DATE_LONGDATE: 3453 3454 if(!(*lpDateFmtEnumProc)("dd MMMM yyyy")) return TRUE; 3454 3455 if(!(*lpDateFmtEnumProc)("d MMMM yyyy")) return TRUE; 3455 return TRUE;3456 return TRUE; 3456 3457 default: 3457 FIXME("Unknown date format (%ld)\n", dwFlags); 3458 SetLastError(ERROR_INVALID_PARAMETER);3459 return FALSE;3458 FIXME("Unknown date format (%ld)\n", dwFlags); 3459 SetLastError(ERROR_INVALID_PARAMETER); 3460 return FALSE; 3460 3461 } 3461 3462 } 3462 3463 3463 case 0x00001c09: /* (Loc,"en_ZA") */ 3464 { 3464 case 0x00001c09: /* (Loc,"en_ZA") */ 3465 { 3465 3466 switch(dwFlags) 3466 3467 { 3467 3468 case DATE_SHORTDATE: 3468 if(!(*lpDateFmtEnumProc)("yy/MM/dd")) return TRUE;3469 return TRUE;3469 if(!(*lpDateFmtEnumProc)("yy/MM/dd")) return TRUE; 3470 return TRUE; 3470 3471 case DATE_LONGDATE: 3471 3472 if(!(*lpDateFmtEnumProc)("dd MMMM yyyy")) return TRUE; 3472 return TRUE;3473 return TRUE; 3473 3474 default: 3474 FIXME("Unknown date format (%ld)\n", dwFlags); 3475 SetLastError(ERROR_INVALID_PARAMETER);3476 return FALSE;3475 FIXME("Unknown date format (%ld)\n", dwFlags); 3476 SetLastError(ERROR_INVALID_PARAMETER); 3477 return FALSE; 3477 3478 } 3478 3479 } 3479 3480 3480 case 0x00002009: /* (Loc,"en_JM") */ 3481 { 3481 case 0x00002009: /* (Loc,"en_JM") */ 3482 { 3482 3483 switch(dwFlags) 3483 3484 { 3484 3485 case DATE_SHORTDATE: 3485 if(!(*lpDateFmtEnumProc)("dd/MM/yyyy")) return TRUE;3486 return TRUE;3486 if(!(*lpDateFmtEnumProc)("dd/MM/yyyy")) return TRUE; 3487 return TRUE; 3487 3488 case DATE_LONGDATE: 3488 3489 if(!(*lpDateFmtEnumProc)("dddd,MMMM dd,yyyy")) return TRUE; … … 3490 3491 if(!(*lpDateFmtEnumProc)("dddd,dd MMMM,yyyy")) return TRUE; 3491 3492 if(!(*lpDateFmtEnumProc)("dd MMMM,yyyy")) return TRUE; 3492 return TRUE;3493 return TRUE; 3493 3494 default: 3494 FIXME("Unknown date format (%ld)\n", dwFlags); 3495 SetLastError(ERROR_INVALID_PARAMETER);3496 return FALSE;3495 FIXME("Unknown date format (%ld)\n", dwFlags); 3496 SetLastError(ERROR_INVALID_PARAMETER); 3497 return FALSE; 3497 3498 } 3498 3499 } 3499 3500 3500 3501 case 0x00002809: /* (Loc,"en_BZ") */ 3501 case 0x00002c09: /* (Loc,"en_TT") */ 3502 { 3502 case 0x00002c09: /* (Loc,"en_TT") */ 3503 { 3503 3504 switch(dwFlags) 3504 3505 { 3505 3506 case DATE_SHORTDATE: 3506 if(!(*lpDateFmtEnumProc)("dd/MM/yyyy")) return TRUE;3507 return TRUE;3507 if(!(*lpDateFmtEnumProc)("dd/MM/yyyy")) return TRUE; 3508 return TRUE; 3508 3509 case DATE_LONGDATE: 3509 3510 if(!(*lpDateFmtEnumProc)("dddd,dd MMMM yyyy")) return TRUE; 3510 return TRUE;3511 return TRUE; 3511 3512 default: 3512 FIXME("Unknown date format (%ld)\n", dwFlags); 3513 SetLastError(ERROR_INVALID_PARAMETER);3514 return FALSE;3513 FIXME("Unknown date format (%ld)\n", dwFlags); 3514 SetLastError(ERROR_INVALID_PARAMETER); 3515 return FALSE; 3515 3516 } 3516 3517 } … … 3521 3522 { 3522 3523 case DATE_SHORTDATE: 3523 if(!(*lpDateFmtEnumProc)("M/d/yy")) return TRUE;3524 if(!(*lpDateFmtEnumProc)("M/d/yyyy")) return TRUE;3525 if(!(*lpDateFmtEnumProc)("MM/dd/yy")) return TRUE;3526 if(!(*lpDateFmtEnumProc)("MM/dd/yyyy")) return TRUE;3527 if(!(*lpDateFmtEnumProc)("yy/MM/dd")) return TRUE;3528 if(!(*lpDateFmtEnumProc)("dd-MMM-yy")) return TRUE;3529 return TRUE;3524 if(!(*lpDateFmtEnumProc)("M/d/yy")) return TRUE; 3525 if(!(*lpDateFmtEnumProc)("M/d/yyyy")) return TRUE; 3526 if(!(*lpDateFmtEnumProc)("MM/dd/yy")) return TRUE; 3527 if(!(*lpDateFmtEnumProc)("MM/dd/yyyy")) return TRUE; 3528 if(!(*lpDateFmtEnumProc)("yy/MM/dd")) return TRUE; 3529 if(!(*lpDateFmtEnumProc)("dd-MMM-yy")) return TRUE; 3530 return TRUE; 3530 3531 case DATE_LONGDATE: 3531 3532 if(!(*lpDateFmtEnumProc)("dddd, MMMM dd, yyyy")) return TRUE; … … 3533 3534 if(!(*lpDateFmtEnumProc)("dddd, dd MMMM, yyyy")) return TRUE; 3534 3535 if(!(*lpDateFmtEnumProc)("dd MMMM, yyyy")) return TRUE; 3535 return TRUE;3536 return TRUE; 3536 3537 default: 3537 FIXME("Unknown date format (%ld)\n", dwFlags); 3538 SetLastError(ERROR_INVALID_PARAMETER);3539 return FALSE;3538 FIXME("Unknown date format (%ld)\n", dwFlags); 3539 SetLastError(ERROR_INVALID_PARAMETER); 3540 return FALSE; 3540 3541 } 3541 3542 } … … 3544 3545 3545 3546 /************************************************************************** 3546 * EnumDateFormatsW (KERNEL32.199)3547 * EnumDateFormatsW (KERNEL32.199) 3547 3548 */ 3548 3549 BOOL WINAPI EnumDateFormatsW( … … 3555 3556 3556 3557 /************************************************************************** 3557 * EnumTimeFormatsA (KERNEL32.210)3558 * EnumTimeFormatsA (KERNEL32.210) 3558 3559 */ 3559 3560 BOOL WINAPI EnumTimeFormatsA( 3560 3561 TIMEFMT_ENUMPROCA lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags) 3561 3562 { 3562 LCID Loc = GetUserDefaultLCID(); 3563 LCID Loc = GetUserDefaultLCID(); 3563 3564 if(!lpTimeFmtEnumProc) 3564 3565 { … … 3568 3569 if(dwFlags) 3569 3570 { 3570 FIXME("Unknown time format (%ld)\n", dwFlags); 3571 FIXME("Unknown time format (%ld)\n", dwFlags); 3571 3572 } 3572 3573 … … 3575 3576 case 0x00000407: /* (Loc,"de_DE") */ 3576 3577 { 3577 if(!(*lpTimeFmtEnumProc)("HH.mm")) return TRUE; 3578 if(!(*lpTimeFmtEnumProc)("HH.mm")) return TRUE; 3578 3579 if(!(*lpTimeFmtEnumProc)("HH:mm:ss")) return TRUE; 3579 3580 if(!(*lpTimeFmtEnumProc)("H:mm:ss")) return TRUE; … … 3581 3582 if(!(*lpTimeFmtEnumProc)("H.mm'Uhr'")) return TRUE; 3582 3583 return TRUE; 3583 } 3584 } 3584 3585 3585 3586 case 0x0000040c: /* (Loc,"fr_FR") */ … … 3595 3596 3596 3597 case 0x00000809: /* (Loc,"en_UK") */ 3597 case 0x00000c09: /* (Loc,"en_AU") */ 3598 case 0x00000c09: /* (Loc,"en_AU") */ 3598 3599 case 0x00001409: /* (Loc,"en_NZ") */ 3599 case 0x00001809: /* (Loc,"en_IE") */ 3600 case 0x00001809: /* (Loc,"en_IE") */ 3600 3601 { 3601 3602 if(!(*lpTimeFmtEnumProc)("h:mm:ss tt")) return TRUE; … … 3605 3606 } 3606 3607 3607 case 0x00001c09: /* (Loc,"en_ZA") */ 3608 case 0x00001c09: /* (Loc,"en_ZA") */ 3608 3609 case 0x00002809: /* (Loc,"en_BZ") */ 3609 case 0x00002c09: /* (Loc,"en_TT") */ 3610 case 0x00002c09: /* (Loc,"en_TT") */ 3610 3611 { 3611 3612 if(!(*lpTimeFmtEnumProc)("h:mm:ss tt")) return TRUE; 3612 if(!(*lpTimeFmtEnumProc)("hh:mm:ss tt")) return TRUE; 3613 return TRUE; 3613 if(!(*lpTimeFmtEnumProc)("hh:mm:ss tt")) return TRUE; 3614 return TRUE; 3614 3615 } 3615 3616 3616 default: /* default to US style "en_US" */ 3617 default: /* default to US style "en_US" */ 3617 3618 { 3618 3619 if(!(*lpTimeFmtEnumProc)("h:mm:ss tt")) return TRUE; … … 3626 3627 3627 3628 /************************************************************************** 3628 * EnumTimeFormatsW (KERNEL32.211)3629 * EnumTimeFormatsW (KERNEL32.211) 3629 3630 */ 3630 3631 BOOL WINAPI EnumTimeFormatsW( … … 3639 3640 * This function is used just locally ! 3640 3641 * Description: Inverts a string. 3641 */ 3642 */ 3642 3643 static void OLE_InvertString(char* string) 3643 { 3644 { 3644 3645 char sTmpArray[128]; 3645 3646 INT counter, i = 0; … … 3658 3659 * Description: Test if the given string (psNumber) is valid or not. 3659 3660 * The valid characters are the following: 3660 * - Characters '0' through '9'. 3661 * - One decimal point (dot) if the number is a floating-point value. 3662 * - A minus sign in the first character position if the number is 3661 * - Characters '0' through '9'. 3662 * - One decimal point (dot) if the number is a floating-point value. 3663 * - A minus sign in the first character position if the number is 3663 3664 * a negative value. 3664 3665 * If the function succeeds, psBefore/psAfter will point to the string 3665 * on the right/left of the decimal symbol. pbNegative indicates if the 3666 * on the right/left of the decimal symbol. pbNegative indicates if the 3666 3667 * number is negative. 3667 3668 */ 3668 3669 static INT OLE_GetNumberComponents(char* pInput, char* psBefore, char* psAfter, BOOL* pbNegative) 3669 3670 { 3670 char sNumberSet[] = "0123456789";3671 BOOL bInDecimal = FALSE;3672 3673 /* Test if we do have a minus sign */3674 if ( *pInput == '-' )3675 {3676 *pbNegative = TRUE;3677 pInput++; /* Jump to the next character. */3678 }3679 3680 while(*pInput != '\0')3681 {3682 /* Do we have a valid numeric character */3683 if ( strchr(sNumberSet, *pInput) != NULL )3684 {3685 if (bInDecimal == TRUE)3671 char sNumberSet[] = "0123456789"; 3672 BOOL bInDecimal = FALSE; 3673 3674 /* Test if we do have a minus sign */ 3675 if ( *pInput == '-' ) 3676 { 3677 *pbNegative = TRUE; 3678 pInput++; /* Jump to the next character. */ 3679 } 3680 3681 while(*pInput != '\0') 3682 { 3683 /* Do we have a valid numeric character */ 3684 if ( strchr(sNumberSet, *pInput) != NULL ) 3685 { 3686 if (bInDecimal == TRUE) 3686 3687 *psAfter++ = *pInput; 3687 else3688 else 3688 3689 *psBefore++ = *pInput; 3689 }3690 else3691 {3692 /* Is this a decimal point (dot) */3693 if ( *pInput == '.' )3694 {3695 /* Is it the first time we find it */3696 if ((bInDecimal == FALSE))3697 bInDecimal = TRUE;3698 else3699 return -1; /* ERROR: Invalid parameter */3700 }3701 else3702 {3703 /* It's neither a numeric character, nor a decimal point.3704 * Thus, return an error.3690 } 3691 else 3692 { 3693 /* Is this a decimal point (dot) */ 3694 if ( *pInput == '.' ) 3695 { 3696 /* Is it the first time we find it */ 3697 if ((bInDecimal == FALSE)) 3698 bInDecimal = TRUE; 3699 else 3700 return -1; /* ERROR: Invalid parameter */ 3701 } 3702 else 3703 { 3704 /* It's neither a numeric character, nor a decimal point. 3705 * Thus, return an error. 3705 3706 */ 3706 return -1;3707 }3708 }3707 return -1; 3708 } 3709 } 3709 3710 pInput++; 3710 }3711 3712 /* Add an End of Line character to the output buffers */3713 *psBefore = '\0';3714 *psAfter = '\0';3715 3716 return 0; 3711 } 3712 3713 /* Add an End of Line character to the output buffers */ 3714 *psBefore = '\0'; 3715 *psAfter = '\0'; 3716 3717 return 0; 3717 3718 } 3718 3719 3719 3720 /************************************************************************** 3720 3721 * This function is used just locally ! 3721 * Description: A number could be formatted using different numbers 3722 * Description: A number could be formatted using different numbers 3722 3723 * of "digits in group" (example: 4;3;2;0). 3723 3724 * The first parameter of this function is an array … … 3742 3743 memcpy(sData, sRule+index, 1); 3743 3744 memcpy(sData+1, "\0", 1); 3744 nData = atoi(sData); 3745 } 3746 3745 nData = atoi(sData); 3746 } 3747 3747 3748 else 3748 3749 { 3749 3750 memcpy(sData, sRule+nRuleSize-1, 1); 3750 3751 memcpy(sData+1, "\0", 1); 3751 nData = atoi(sData); 3752 } 3753 3752 nData = atoi(sData); 3753 } 3754 3754 3755 return nData; 3755 3756 } 3756 3757 3757 3758 /************************************************************************** 3758 * GetNumberFormatA (KERNEL32.355)3759 * GetNumberFormatA (KERNEL32.355) 3759 3760 */ 3760 3761 INT WINAPI GetNumberFormatA(LCID locale, DWORD dwflags, 3761 LPCSTR lpvalue, const NUMBERFMTA * lpFormat,3762 LPSTR lpNumberStr, int cchNumber)3762 LPCSTR lpvalue, const NUMBERFMTA * lpFormat, 3763 LPSTR lpNumberStr, int cchNumber) 3763 3764 { 3764 3765 char sNumberDigits[3], sDecimalSymbol[5], sDigitsInGroup[11], sDigitGroupSymbol[5], sILZero[2]; 3765 3766 INT nNumberDigits, nNumberDecimal, i, j, nCounter, nStep, nRuleIndex, nGrouping, nDigits, retVal, nLZ; 3766 3767 char sNumber[128], sDestination[128], sDigitsAfterDecimal[10], sDigitsBeforeDecimal[128]; 3767 char sRule[10], sSemiColumn[]=";", sBuffer[5], sNegNumber[2]; 3768 char sRule[10], sSemiColumn[]=";", sBuffer[5], sNegNumber[2]; 3768 3769 char *pStr = NULL, *pTmpStr = NULL; 3769 3770 LCID systemDefaultLCID; 3770 3771 BOOL bNegative = FALSE; 3771 enum Operations 3772 enum Operations 3772 3773 { 3773 3774 USE_PARAMETER, … … 3800 3801 { 3801 3802 if (dwflags == 0) 3802 used_operation = USE_PARAMETER; 3803 used_operation = USE_PARAMETER; 3803 3804 } 3804 3805 else … … 3844 3845 3845 3846 nNumberDigits = atoi(sNumberDigits); 3846 3847 3847 3848 /* Remove the ";" */ 3848 3849 i=0; … … 3860 3861 memcpy(sRule, sBuffer, 1); /* Number of digits in the groups ( used by OLE_GetGrouping() ) */ 3861 3862 memcpy(sRule + j, "\0", 1); 3862 3863 3863 3864 /* First, format the digits before the decimal. */ 3864 if ((nNumberDecimal>0) && (atoi(sDigitsBeforeDecimal) != 0)) 3865 if ((nNumberDecimal>0) && (atoi(sDigitsBeforeDecimal) != 0)) 3865 3866 { 3866 3867 /* Working on an inverted string is easier ! */ … … 3870 3871 nRuleIndex = 1; 3871 3872 nGrouping = OLE_GetGrouping(sRule, nRuleIndex); 3872 3873 3873 3874 /* Here, we will loop until we reach the end of the string. 3874 * An internal counter (j) is used in order to know when to 3875 * An internal counter (j) is used in order to know when to 3875 3876 * insert the "digit group symbol". 3876 3877 */ … … 3902 3903 nLZ = atoi(sILZero); 3903 3904 if (nLZ != 0) 3904 { 3905 { 3905 3906 /* Use 0.xxx instead of .xxx */ 3906 3907 memcpy(sDestination, "0", 1); … … 3917 3918 if ( (nDigits>0) && (pStr = strstr (sNumber, ".")) ) 3918 3919 { 3919 i = strlen(sNumber) - strlen(pStr) + 1; 3920 i = strlen(sNumber) - strlen(pStr) + 1; 3920 3921 strncpy ( sDigitsAfterDecimal, sNumber + i, nNumberDigits); 3921 3922 j = strlen(sDigitsAfterDecimal); 3922 3923 if (j < nNumberDigits) 3923 nCounter = nNumberDigits-j; 3924 nCounter = nNumberDigits-j; 3924 3925 } 3925 3926 for (i=0;i<nCounter;i++) 3926 memcpy(sDigitsAfterDecimal+i+j, "0", 1); 3927 memcpy(sDigitsAfterDecimal + nNumberDigits, "\0", 1); 3927 memcpy(sDigitsAfterDecimal+i+j, "0", 1); 3928 memcpy(sDigitsAfterDecimal + nNumberDigits, "\0", 1); 3928 3929 3929 3930 i = strlen(sDestination); 3930 3931 j = strlen(sDigitsAfterDecimal); 3931 3932 /* Finally, construct the resulting formatted string. */ 3932 3933 3933 3934 for (nCounter=0; nCounter<i; nCounter++) 3934 3935 memcpy(sNumber + nCounter, sDestination + nCounter, 1); 3935 3936 3936 3937 memcpy(sNumber + nCounter, sDecimalSymbol, strlen(sDecimalSymbol)); 3937 3938 … … 3939 3940 memcpy(sNumber + nCounter+i+strlen(sDecimalSymbol), sDigitsAfterDecimal + i, 1); 3940 3941 memcpy(sNumber + nCounter+i+strlen(sDecimalSymbol), "\0", 1); 3941 3942 3942 3943 /* Is it a negative number */ 3943 3944 if (bNegative == TRUE) … … 3947 3948 pTmpStr = sNumber; 3948 3949 switch (i) 3949 { 3950 { 3950 3951 case 0: 3951 3952 *pStr++ = '('; 3952 3953 while (*sNumber != '\0') 3953 3954 *pStr++ = *pTmpStr++; 3954 *pStr++ = ')'; 3955 break; 3955 *pStr++ = ')'; 3956 break; 3956 3957 case 1: 3957 3958 *pStr++ = '-'; … … 3985 3986 strcpy(sDestination, sNumber); 3986 3987 3987 /* If cchNumber is zero, then returns the number of bytes or characters 3988 /* If cchNumber is zero, then returns the number of bytes or characters 3988 3989 * required to hold the formatted number string 3989 3990 */ 3990 3991 if (cchNumber==0) 3991 3992 retVal = strlen(sDestination) + 1; 3992 else 3993 else 3993 3994 { 3994 3995 strncpy (lpNumberStr, sDestination, cchNumber-1); … … 3996 3997 retVal = strlen(lpNumberStr); 3997 3998 } 3998 3999 3999 4000 return retVal; 4000 4001 } 4001 4002 4002 4003 /************************************************************************** 4003 * GetNumberFormatW (KERNEL32.@)4004 * GetNumberFormatW (KERNEL32.@) 4004 4005 */ 4005 4006 INT WINAPI GetNumberFormatW(LCID locale, DWORD dwflags, 4006 LPCWSTR lpvalue, const NUMBERFMTW * lpFormat,4007 LPWSTR lpNumberStr, int cchNumber)4007 LPCWSTR lpvalue, const NUMBERFMTW * lpFormat, 4008 LPWSTR lpNumberStr, int cchNumber) 4008 4009 { 4009 4010 FIXME("%s: stub, no reformating done\n",debugstr_w(lpvalue)); … … 4014 4015 4015 4016 /************************************************************************** 4016 * GetCurrencyFormatA (KERNEL32.302)4017 * GetCurrencyFormatA (KERNEL32.302) 4017 4018 */ 4018 4019 INT WINAPI GetCurrencyFormatA(LCID locale, DWORD dwflags, 4019 LPCSTR lpvalue, const CURRENCYFMTA * lpFormat,4020 LPSTR lpCurrencyStr, int cchCurrency)4020 LPCSTR lpvalue, const CURRENCYFMTA * lpFormat, 4021 LPSTR lpCurrencyStr, int cchCurrency) 4021 4022 { 4022 4023 UINT nPosOrder, nNegOrder; … … 4028 4029 LCID systemDefaultLCID; 4029 4030 BOOL bIsPositive = FALSE, bValidFormat = FALSE; 4030 enum Operations 4031 enum Operations 4031 4032 { 4032 4033 USE_PARAMETER, … … 4043 4044 { 4044 4045 if (dwflags == 0) 4045 used_operation = USE_PARAMETER; 4046 used_operation = USE_PARAMETER; 4046 4047 } 4047 4048 else … … 4056 4057 switch(used_operation) 4057 4058 { 4058 case USE_LOCALEINFO: 4059 case USE_LOCALEINFO: 4059 4060 /* Specific to CURRENCYFMTA*/ 4060 4061 GetLocaleInfoA(locale, LOCALE_INEGCURR, sNegOrder, sizeof(sNegOrder)); 4061 4062 GetLocaleInfoA(locale, LOCALE_ICURRENCY, sPosOrder, sizeof(sPosOrder)); 4062 4063 GetLocaleInfoA(locale, LOCALE_SCURRENCY, sCurrencySymbol, sizeof(sCurrencySymbol)); 4063 4064 4064 4065 nPosOrder = atoi(sPosOrder); 4065 4066 nNegOrder = atoi(sNegOrder); 4066 4067 break; 4067 case USE_PARAMETER: 4068 case USE_PARAMETER: 4068 4069 /* Specific to CURRENCYFMTA*/ 4069 4070 nNegOrder = lpFormat->NegativeOrder; … … 4072 4073 break; 4073 4074 case USE_SYSTEMDEFAULT: 4074 systemDefaultLCID = GetSystemDefaultLCID(); 4075 systemDefaultLCID = GetSystemDefaultLCID(); 4075 4076 /* Specific to CURRENCYFMTA*/ 4076 4077 GetLocaleInfoA(systemDefaultLCID, LOCALE_INEGCURR, sNegOrder, sizeof(sNegOrder)); 4077 4078 GetLocaleInfoA(systemDefaultLCID, LOCALE_ICURRENCY, sPosOrder, sizeof(sPosOrder)); 4078 4079 GetLocaleInfoA(systemDefaultLCID, LOCALE_SCURRENCY, sCurrencySymbol, sizeof(sCurrencySymbol)); 4079 4080 4080 4081 nPosOrder = atoi(sPosOrder); 4081 4082 nNegOrder = atoi(sNegOrder); … … 4085 4086 return 0; 4086 4087 } 4087 4088 4088 4089 /* Construct a temporary number format structure */ 4089 4090 if (lpFormat != NULL) … … 4109 4110 retVal = GetNumberFormatA(locale,0,lpvalue,(bValidFormat)?&numberFmt:NULL,pNumberFormated,128); 4110 4111 } 4111 4112 4112 4113 if (retVal == 0) 4113 4114 return 0; … … 4224 4225 break; 4225 4226 case 14: /* format: ($ 1.1) */ 4226 strcpy (pDestination, "("); 4227 strcpy (pDestination, "("); 4227 4228 strcat (pDestination, sCurrencySymbol); 4228 4229 strcat (pDestination, " "); … … 4231 4232 break; 4232 4233 case 15: /* format: (1.1 $) */ 4233 strcpy (pDestination, "("); 4234 strcpy (pDestination, "("); 4234 4235 strcat (pDestination, pNumberFormated); 4235 4236 strcat (pDestination, " "); … … 4251 4252 *(lpCurrencyStr+cchCurrency-1) = '\0'; /* ensure we got a NULL at the end */ 4252 4253 return strlen(lpCurrencyStr); 4253 } 4254 } 4254 4255 } 4255 4256 4256 4257 /************************************************************************** 4257 * GetCurrencyFormatW (KERNEL32.303)4258 * GetCurrencyFormatW (KERNEL32.303) 4258 4259 */ 4259 4260 INT WINAPI GetCurrencyFormatW(LCID locale, DWORD dwflags, 4260 LPCWSTR lpvalue, const CURRENCYFMTW * lpFormat,4261 LPWSTR lpCurrencyStr, int cchCurrency)4261 LPCWSTR lpvalue, const CURRENCYFMTW * lpFormat, 4262 LPWSTR lpCurrencyStr, int cchCurrency) 4262 4263 { 4263 4264 FIXME("This API function is NOT implemented !\n"); … … 4266 4267 4267 4268 /****************************************************************************** 4268 * OLE2NLS_CheckLocale[intern]4269 */ 4269 * OLE2NLS_CheckLocale [intern] 4270 */ 4270 4271 static LCID OLE2NLS_CheckLocale (LCID locale) 4271 4272 { 4272 if (!locale) 4273 { locale = LOCALE_SYSTEM_DEFAULT;4274 }4275 4276 if (locale == LOCALE_SYSTEM_DEFAULT) 4277 { return GetSystemDefaultLCID();4278 } 4279 else if (locale == LOCALE_USER_DEFAULT) 4280 { return GetUserDefaultLCID();4281 }4282 else4283 { return locale;4284 }4273 if (!locale) 4274 { locale = LOCALE_SYSTEM_DEFAULT; 4275 } 4276 4277 if (locale == LOCALE_SYSTEM_DEFAULT) 4278 { return GetSystemDefaultLCID(); 4279 } 4280 else if (locale == LOCALE_USER_DEFAULT) 4281 { return GetUserDefaultLCID(); 4282 } 4283 else 4284 { return locale; 4285 } 4285 4286 } 4286 4287 /****************************************************************************** 4287 * GetTimeFormatA[KERNEL32.422]4288 * GetTimeFormatA [KERNEL32.422] 4288 4289 * Makes an ASCII string of the time 4289 4290 * … … 4303 4304 * 4304 4305 */ 4305 INT WINAPI 4306 INT WINAPI 4306 4307 GetTimeFormatA(LCID locale, /* [in] */ 4307 DWORD flags, /* [in] */4308 LPSYSTEMTIME xtime, /* [in] */ 4309 LPCSTR format, /* [in] */4310 LPSTR timestr, /* [out] */4311 INT timelen /* [in] */) 4308 DWORD flags, /* [in] */ 4309 LPSYSTEMTIME xtime, /* [in] */ 4310 LPCSTR format, /* [in] */ 4311 LPSTR timestr, /* [out] */ 4312 INT timelen /* [in] */) 4312 4313 { char format_buf[40]; 4313 4314 LPCSTR thisformat; … … 4317 4318 DWORD thisflags=LOCALE_STIMEFORMAT; /* standart timeformat */ 4318 4319 INT ret; 4319 4320 4320 4321 TRACE("GetTimeFormat(0x%04lx,0x%08lx,%p,%s,%p,%d)\n",locale,flags,xtime,format,timestr,timelen); 4321 4322 4322 4323 thislocale = OLE2NLS_CheckLocale ( locale ); 4323 4324 4324 if (format == NULL) 4325 if (format == NULL) 4325 4326 { if (flags & LOCALE_NOUSEROVERRIDE) /*use system default*/ 4326 4327 { thislocale = GetSystemDefaultLCID(); … … 4329 4330 thisformat = format_buf; 4330 4331 } 4331 else 4332 else 4332 4333 { thisformat = format; 4333 4334 } 4334 4335 4335 4336 if (xtime == NULL) /* NULL means use the current local time*/ 4336 4337 { GetLocalTime(&t); 4337 4338 thistime = &t; 4338 } 4339 } 4339 4340 else 4340 4341 { thistime = xtime; … … 4342 4343 } 4343 4344 ret = OLE_GetFormatA(thislocale, thisflags, flags, thistime, thisformat, 4344 timestr, timelen);4345 timestr, timelen); 4345 4346 return ret; 4346 4347 } … … 4348 4349 4349 4350 /****************************************************************************** 4350 * GetTimeFormatW[KERNEL32.423]4351 * GetTimeFormatW [KERNEL32.423] 4351 4352 * Makes a Unicode string of the time 4352 4353 */ 4353 INT WINAPI 4354 INT WINAPI 4354 4355 GetTimeFormatW(LCID locale, /* [in] */ 4355 DWORD flags, /* [in] */4356 LPSYSTEMTIME xtime, /* [in] */ 4357 LPCWSTR format, /* [in] */4358 LPWSTR timestr, /* [out] */4359 INT timelen /* [in] */) 4360 { WCHAR format_buf[40];4361 LPCWSTR thisformat;4362 SYSTEMTIME t;4363 LPSYSTEMTIME thistime;4364 LCID thislocale=0;4365 DWORD thisflags=LOCALE_STIMEFORMAT; /* standart timeformat */4366 INT ret;4367 4368 TRACE("GetTimeFormat(0x%04lx,0x%08lx,%p,%s,%p,%d)\n",locale,flags,4369 xtime,debugstr_w(format),timestr,timelen);4370 4371 thislocale = OLE2NLS_CheckLocale ( locale );4372 4373 if (format == NULL) 4374 { if (flags & LOCALE_NOUSEROVERRIDE) /*use system default*/4375 { thislocale = GetSystemDefaultLCID();4376 }4377 GetLocaleInfoW(thislocale, thisflags, format_buf, 40);4378 thisformat = format_buf;4379 } 4380 else 4381 { thisformat = format;4382 }4383 4384 if (xtime == NULL) /* NULL means use the current local time*/4385 { GetLocalTime(&t);4386 thistime = &t;4387 } 4388 else4389 { thistime = xtime;4390 }4391 4392 ret = OLE_GetFormatW(thislocale, thisflags, flags, thistime, thisformat,4393 timestr, timelen);4394 return ret;4356 DWORD flags, /* [in] */ 4357 LPSYSTEMTIME xtime, /* [in] */ 4358 LPCWSTR format, /* [in] */ 4359 LPWSTR timestr, /* [out] */ 4360 INT timelen /* [in] */) 4361 { WCHAR format_buf[40]; 4362 LPCWSTR thisformat; 4363 SYSTEMTIME t; 4364 LPSYSTEMTIME thistime; 4365 LCID thislocale=0; 4366 DWORD thisflags=LOCALE_STIMEFORMAT; /* standart timeformat */ 4367 INT ret; 4368 4369 TRACE("GetTimeFormat(0x%04lx,0x%08lx,%p,%s,%p,%d)\n",locale,flags, 4370 xtime,debugstr_w(format),timestr,timelen); 4371 4372 thislocale = OLE2NLS_CheckLocale ( locale ); 4373 4374 if (format == NULL) 4375 { if (flags & LOCALE_NOUSEROVERRIDE) /*use system default*/ 4376 { thislocale = GetSystemDefaultLCID(); 4377 } 4378 GetLocaleInfoW(thislocale, thisflags, format_buf, 40); 4379 thisformat = format_buf; 4380 } 4381 else 4382 { thisformat = format; 4383 } 4384 4385 if (xtime == NULL) /* NULL means use the current local time*/ 4386 { GetLocalTime(&t); 4387 thistime = &t; 4388 } 4389 else 4390 { thistime = xtime; 4391 } 4392 4393 ret = OLE_GetFormatW(thislocale, thisflags, flags, thistime, thisformat, 4394 timestr, timelen); 4395 return ret; 4395 4396 } 4396 4397 4397 4398 /****************************************************************************** 4398 * EnumCalendarInfoA[KERNEL32.196]4399 * EnumCalendarInfoA [KERNEL32.196] 4399 4400 */ 4400 4401 BOOL WINAPI EnumCalendarInfoA( 4401 CALINFO_ENUMPROCA calinfoproc,LCID locale,CALID calendar,CALTYPE caltype4402 CALINFO_ENUMPROCA calinfoproc,LCID locale,CALID calendar,CALTYPE caltype 4402 4403 ) { 4403 FIXME("(%p,0x%04lx,0x%08lx,0x%08lx),stub!\n",calinfoproc,locale,calendar,caltype);4404 return FALSE;4404 FIXME("(%p,0x%04lx,0x%08lx,0x%08lx),stub!\n",calinfoproc,locale,calendar,caltype); 4405 return FALSE; 4405 4406 } 4406 4407 -
trunk/src/kernel32/ordinals.cpp
r5308 r6646 1 2 /*1 /* $Id: ordinals.cpp,v 1.4 2001-09-05 12:58:00 bird Exp $ 2 * 3 3 * Win32 KERNEL32 Subsystem for OS/2 4 4 * … … 57 57 58 58 /********************************************************************** 59 * _KERNEL32_10059 * _KERNEL32_100 60 60 */ 61 61 BOOL WINAPI KERNEL32_100(HANDLE threadid,DWORD exitcode,DWORD x) 62 62 { 63 dprintf(("_KERNEL32_100 (%d,%ld,0x%08lx): STUB",threadid,exitcode,x));64 return TRUE;63 dprintf(("_KERNEL32_100 (%d,%ld,0x%08lx): STUB",threadid,exitcode,x)); 64 return TRUE; 65 65 } 66 66 … … 101 101 // it's some function dispatcher 102 102 SetLastError(0x78); 103 103 104 104 //@@@PH we should now get the correct CL value */ 105 105 BYTE CL; … … 114 114 default: ret = 0; break; 115 115 } 116 116 117 117 // select jump function 118 118 VOID* pfn = (VOID*)pFunctionTable[CL & 0x0F]; … … 127 127 * Variables : 128 128 * Result : Unknown 129 * Remark : 129 * Remark : 130 130 * Status : UNTESTED STUB 131 131 * -
trunk/src/kernel32/stubs.cpp
r5587 r6646 1 2 /*1 /* $Id: stubs.cpp,v 1.32 2001-09-05 12:58:00 bird Exp $ 2 * 3 3 * Win32 KERNEL32 Subsystem for OS/2 4 4 *
Note:
See TracChangeset
for help on using the changeset viewer.
