- Timestamp:
- Apr 29, 2000, 8:26:59 PM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.DEF
r3375 r3461 1 ; $Id: KERNEL32.DEF,v 1. 79 2000-04-14 22:35:26 sandervl Exp $1 ; $Id: KERNEL32.DEF,v 1.80 2000-04-29 18:26:56 sandervl Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 1084 1084 _GetCPUFeatures @2004 1085 1085 CPUFeatures @2005 1086 InitSystemAndRegistry__Fv @2006 1086 1087 1087 1088 ;registry apis imported by advapi32 -
trunk/src/kernel32/cpu.cpp
r2984 r3461 1 /* $Id: cpu.cpp,v 1. 7 2000-03-03 11:15:57 sandervl Exp $ */1 /* $Id: cpu.cpp,v 1.8 2000-04-29 18:26:57 sandervl Exp $ */ 2 2 /* 3 3 * Odin win32 CPU apis … … 27 27 DEFAULT_DEBUG_CHANNEL(CPU) 28 28 29 static BYTE PF[64] = {0,}; 30 static nrCPUs = 1; 29 static BYTE PF[64] = {0,}; 30 static nrCPUs = 1; 31 static SYSTEM_INFO cachedsi = {0}; 31 32 32 33 //****************************************************************************** … … 60 61 VOID WINAPI GetSystemInfo(LPSYSTEM_INFO si) /* [out] system information */ 61 62 { 63 HKEY xhkey=0,hkey; 64 HKEY fpukey=0, xhfpukey; 65 char buf[20]; 66 DWORD features, signature; 62 67 static int cache = 0; 63 static SYSTEM_INFO cachedsi;64 HKEY xhkey=0,hkey;65 HKEY fpukey=0, xhfpukey;66 char buf[20];67 DWORD features, signature;68 68 69 69 if(!si) { -
trunk/src/kernel32/dbglocal.cpp
r3206 r3461 1 /* $Id: dbglocal.cpp,v 1. 5 2000-03-23 19:23:44sandervl Exp $ */1 /* $Id: dbglocal.cpp,v 1.6 2000-04-29 18:26:57 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #ifdef DEBUG 17 17 18 USHORT DbgEnabled[DBG_MAXFILES]; 18 USHORT DbgEnabled[DBG_MAXFILES] = {0}; 19 USHORT DbgEnabledLvl2[DBG_MAXFILES] = {0}; 20 19 21 char *DbgFileNames[DBG_MAXFILES] = 20 22 { … … 122 124 { 123 125 char *envvar = getenv(DBG_ENVNAME); 126 char *envvar2= getenv(DBG_ENVNAME_LVL2); 124 127 char *dbgvar; 125 128 int i; … … 129 132 } 130 133 131 if(!envvar) 132 return; 133 134 dbgvar = strstr(envvar, "dll"); 135 if(dbgvar) { 136 if(*(dbgvar-1) == '-') { 137 for(i=0;i<DBG_MAXFILES;i++) { 138 DbgEnabled[i] = 0; 139 } 134 if(envvar) { 135 dbgvar = strstr(envvar, "dll"); 136 if(dbgvar) { 137 if(*(dbgvar-1) == '-') { 138 for(i=0;i<DBG_MAXFILES;i++) { 139 DbgEnabled[i] = 0; 140 } 141 } 142 } 143 for(i=0;i<DBG_MAXFILES;i++) { 144 dbgvar = strstr(envvar, DbgFileNames[i]); 145 if(dbgvar) { 146 if(*(dbgvar-1) == '-') { 147 DbgEnabled[i] = 0; 148 } 149 else 150 if(*(dbgvar-1) == '+') { 151 DbgEnabled[i] = 1; 152 } 153 } 140 154 } 141 155 } 142 for(i=0;i<DBG_MAXFILES;i++) { 143 dbgvar = strstr(envvar, DbgFileNames[i]); 144 if(dbgvar) { 145 if(*(dbgvar-1) == '-') { 146 DbgEnabled[i] = 0; 147 } 148 else 149 if(*(dbgvar-1) == '+') { 150 DbgEnabled[i] = 1; 151 } 156 if(envvar2) { 157 dbgvar = strstr(envvar2, "dll"); 158 if(dbgvar) { 159 if(*(dbgvar-1) == '+') { 160 for(i=0;i<DBG_MAXFILES;i++) { 161 DbgEnabledLvl2[i] = 1; 162 } 163 } 164 } 165 for(i=0;i<DBG_MAXFILES;i++) { 166 dbgvar = strstr(envvar2, DbgFileNames[i]); 167 if(dbgvar) { 168 if(*(dbgvar-1) == '-') { 169 DbgEnabledLvl2[i] = 0; 170 } 171 else 172 if(*(dbgvar-1) == '+') { 173 DbgEnabledLvl2[i] = 1; 174 } 175 } 152 176 } 153 177 } -
trunk/src/kernel32/dbglocal.h
r3206 r3461 1 /* $Id: dbglocal.h,v 1. 5 2000-03-23 19:23:45sandervl Exp $ */1 /* $Id: dbglocal.h,v 1.6 2000-04-29 18:26:58 sandervl Exp $ */ 2 2 3 3 /* … … 18 18 19 19 #define DBG_ENVNAME "dbg_kernel32" 20 #define DBG_ENVNAME_LVL2 "dbg_kernel32_lvl2" 20 21 21 22 #define DBG_kernel32 0 … … 119 120 120 121 extern USHORT DbgEnabled[DBG_MAXFILES]; 122 extern USHORT DbgEnabledLvl2[DBG_MAXFILES]; 121 123 122 124 #ifdef dprintf … … 125 127 126 128 #define dprintf(a) if(DbgEnabled[DBG_LOCALLOG] == 1) WriteLog a 129 130 #ifdef dprintf2 131 #undef dprintf2 132 #endif 133 134 #define dprintf2(a) if(DbgEnabledLvl2[DBG_LOCALLOG] == 1) WriteLog a 127 135 128 136 #else -
trunk/src/kernel32/directory.cpp
r3375 r3461 1 /* $Id: directory.cpp,v 1. 19 2000-04-14 22:35:26sandervl Exp $ */1 /* $Id: directory.cpp,v 1.20 2000-04-29 18:26:58 sandervl Exp $ */ 2 2 3 3 /* … … 63 63 void InitDirectories() 64 64 { 65 GetWindowsDirectoryA((LPSTR)&DIR_Windows, sizeof(DIR_Windows)); 66 GetSystemDirectoryA((LPSTR)&DIR_System, sizeof(DIR_System)); 67 } 68 65 char *endofwinpath, *tmp; 66 int len; 67 68 strcpy(DIR_System, kernel32Path); 69 len = strlen(DIR_System); 70 if(DIR_System[len-1] == '\\') { 71 DIR_System[len-1] = 0; 72 } 73 len = ODIN_PROFILE_GetOdinIniString(ODINDIRECTORIES,"WINDOWS","",DIR_Windows,sizeof(DIR_Windows)); 74 if (len > 2) { 75 if(DIR_Windows[len-1] == '\\') { 76 DIR_Windows[len-1] = 0; 77 } 78 } 79 else { 80 strcpy(DIR_Windows, DIR_System); 81 endofwinpath = tmp = strchr(DIR_Windows, '\\'); 82 while(tmp) { 83 tmp = strchr(endofwinpath+1, '\\'); 84 if(tmp) 85 endofwinpath = tmp; 86 } 87 if(endofwinpath) { 88 *endofwinpath = 0; //remove \SYSTEM32 89 } 90 else DebugInt3(); 91 } 92 } 69 93 /***************************************************************************** 70 94 * Name : GetCurrentDirectoryA … … 231 255 UINT,uSize) 232 256 { 233 char buf[255]; 234 int len; 235 236 lstrcpynA(buf, kernel32Path, sizeof(buf)-1); 237 len = lstrlenA(buf);; 238 if(buf[len-1] == '\\') { 239 buf[len-1] = 0; 240 len--; 241 } 257 int len; 258 char *dir; 259 260 dir = InternalGetSystemDirectoryA(); 261 len = lstrlenA(dir); 242 262 if(lpBuffer) 243 lstrcpynA(lpBuffer, buf, uSize);263 lstrcpynA(lpBuffer, dir, uSize); 244 264 return len; 245 265 } … … 265 285 266 286 if(lpBuffer) 267 asciibuffer = (char *)malloc(uSize+1); 287 asciibuffer = (char *)alloca(uSize+1); 288 289 if(lpBuffer && asciibuffer == NULL) { 290 DebugInt3(); 291 } 268 292 269 293 rc = GetSystemDirectoryA(asciibuffer, uSize); … … 271 295 AsciiToUnicode(asciibuffer, lpBuffer); 272 296 273 if(asciibuffer)274 free(asciibuffer);275 297 return(rc); 276 298 } … … 292 314 UINT,uSize) 293 315 { 294 static int fWindirExists = FALSE; 295 CHAR buf[255]; 296 int len; 297 298 //SvL: Use path of kernel32.dll instead of calling Open32 api (which returns \OS2\SYSTEM) 299 lstrcpynA(buf, kernel32Path, sizeof(buf)-1); 300 strcat(buf, "WIN"); 301 if(!fWindirExists) { 302 O32_CreateDirectory(buf, NULL); 303 fWindirExists = TRUE; 304 } 305 306 len = lstrlenA(buf);; 307 if(buf[len-1] == '\\') { 308 buf[len-1] = 0; 309 len--; 310 } 316 char *dir; 317 int len; 318 319 dir = InternalGetWindowsDirectoryA(); 320 len = lstrlenA(dir); 311 321 if(lpBuffer) 312 lstrcpynA(lpBuffer, buf, uSize);322 lstrcpynA(lpBuffer, dir, uSize); 313 323 return len; 314 324 } … … 334 344 335 345 if(lpBuffer) 336 asciibuffer = (char *)malloc(uSize+1); 346 asciibuffer = (char *)alloca(uSize+1); 347 348 if(lpBuffer && asciibuffer == NULL) { 349 DebugInt3(); 350 } 337 351 338 352 rc = GetWindowsDirectoryA(asciibuffer, uSize); … … 340 354 AsciiToUnicode(asciibuffer, lpBuffer); 341 355 342 if(asciibuffer)343 free(asciibuffer);344 356 return(rc); 345 357 } -
trunk/src/kernel32/initsystem.cpp
r3074 r3461 1 /* $Id: initsystem.cpp,v 1. 8 2000-03-10 16:11:59sandervl Exp $ */1 /* $Id: initsystem.cpp,v 1.9 2000-04-29 18:26:58 sandervl Exp $ */ 2 2 /* 3 3 * Odin system initialization (registry & directories) 4 4 * 5 * Called from the WarpIn install program to create the desktop directories and 6 * to setup the registry 7 * 8 * InitSystemAndRegistry creates: 9 * - WINDOWSDIR\SYSTEM 10 * - WINDOWSDIR\AppData 11 * - WINDOWSDIR\Cache 12 * - WINDOWSDIR\Cookies 13 * - WINDOWSDIR\Desktop 14 * - WINDOWSDIR\Favorites 15 * - WINDOWSDIR\Fonts 16 * - WINDOWSDIR\History 17 * - WINDOWSDIR\NetHood 18 * - WINDOWSDIR\My Documents 19 * - WINDOWSDIR\PrintHood 20 * - WINDOWSDIR\Recent 21 * - WINDOWSDIR\SendTo 22 * - WINDOWSDIR\Start Menu 23 * - WINDOWSDIR\Start Menu\Programs 24 * - WINDOWSDIR\Start Menu\Programs\Startup 25 * - WINDOWSDIR\ShellNew 26 * - and a minimal system registry 5 27 * 6 28 * NOTE: Most of this has to be moved into the Odin install program!!!!! … … 20 42 #include "debugtools.h" 21 43 #include "cpuhlp.h" 22 #include "initsystem.h"44 #include <odininst.h> 23 45 #include "directory.h" 24 46 #include <versionos2.h> … … 41 63 #define INITREG_ERROR "InitRegistry: Unable to register system information" 42 64 43 BOOL InitRegistry(); 44 45 //****************************************************************************** 46 //****************************************************************************** 47 BOOL InitSystemEnvironment(ULONG nrCPUs) 48 { 49 InitSystemInfo(nrCPUs); 50 return InitRegistry(); 51 } 65 //****************************************************************************** 66 //****************************************************************************** 52 67 //****************************************************************************** 53 68 //[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows] … … 60 75 BYTE ShutdownTime[] = {0x44,0x5e,0xf2,0xbb,0x84,0x41,0xbf,0x01}; 61 76 //****************************************************************************** 62 BOOL Init Registry()77 BOOL InitSystemAndRegistry() 63 78 { 64 79 HKEY hkey, hkey1; … … 127 142 // if(RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey) != ERROR_SUCCESS) 128 143 // { 144 //SYSTEM dir 145 strcpy(shellpath, InternalGetWindowsDirectoryA()); 146 strcat(shellpath, "\\SYSTEM"); 147 CreateDirectoryA(shellpath, NULL); 148 149 //AppData 150 strcpy(shellpath, InternalGetWindowsDirectoryA()); 151 strcat(shellpath, "\\Application Data"); 152 CreateDirectoryA(shellpath, NULL); 153 RegSetValueExA(hkey,"AppData",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 154 //Cache 155 strcpy(shellpath, InternalGetWindowsDirectoryA()); 156 strcat(shellpath, "\\Temporary Internet Files"); 157 CreateDirectoryA(shellpath, NULL); 158 RegSetValueExA(hkey,"Cache",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 159 //Cookies 160 strcpy(shellpath, InternalGetWindowsDirectoryA()); 161 strcat(shellpath, "\\Cookies"); 162 CreateDirectoryA(shellpath, NULL); 163 RegSetValueExA(hkey,"Cookies",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 164 //Desktop 165 strcpy(shellpath, InternalGetWindowsDirectoryA()); 166 strcat(shellpath, "\\Desktop"); 167 CreateDirectoryA(shellpath, NULL); 168 RegSetValueExA(hkey,"Desktop",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 169 //Favorites 129 170 strcpy(shellpath, InternalGetWindowsDirectoryA()); 130 171 strcat(shellpath, "\\Favorites"); 131 172 CreateDirectoryA(shellpath, NULL); 132 173 RegSetValueExA(hkey,"Favorites",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 133 strcpy(shellpath, InternalGetWindowsDirectoryA()); 134 strcat(shellpath, "\\Programs\\Startup"); 174 //Fonts 175 strcpy(shellpath, InternalGetWindowsDirectoryA()); 176 strcat(shellpath, "\\Fonts"); 177 CreateDirectoryA(shellpath, NULL); 178 RegSetValueExA(hkey,"Fonts",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 179 //History 180 strcpy(shellpath, InternalGetWindowsDirectoryA()); 181 strcat(shellpath, "\\History"); 182 CreateDirectoryA(shellpath, NULL); 183 RegSetValueExA(hkey,"History",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 184 //NetHood 185 strcpy(shellpath, InternalGetWindowsDirectoryA()); 186 strcat(shellpath, "\\NetHood"); 187 CreateDirectoryA(shellpath, NULL); 188 RegSetValueExA(hkey,"NetHood",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 189 //Personal 190 strcpy(shellpath, InternalGetWindowsDirectoryA()); 191 strcat(shellpath, "\\My Documents"); 192 CreateDirectoryA(shellpath, NULL); 193 RegSetValueExA(hkey,"Personal",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 194 //PrintHood 195 strcpy(shellpath, InternalGetWindowsDirectoryA()); 196 strcat(shellpath, "\\PrintHood"); 197 CreateDirectoryA(shellpath, NULL); 198 RegSetValueExA(hkey,"PrintHood",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 199 //Recent 200 strcpy(shellpath, InternalGetWindowsDirectoryA()); 201 strcat(shellpath, "\\Recent"); 202 CreateDirectoryA(shellpath, NULL); 203 RegSetValueExA(hkey,"Recent",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 204 //SendTo 205 strcpy(shellpath, InternalGetWindowsDirectoryA()); 206 strcat(shellpath, "\\SendTo"); 207 CreateDirectoryA(shellpath, NULL); 208 RegSetValueExA(hkey,"SendTo",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 209 //Start Menu 210 strcpy(shellpath, InternalGetWindowsDirectoryA()); 211 strcat(shellpath, "\\Start Menu"); 212 CreateDirectoryA(shellpath, NULL); 213 RegSetValueExA(hkey,"Start Menu",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 214 //Programs 215 strcpy(shellpath, InternalGetWindowsDirectoryA()); 216 strcat(shellpath, "\\Start Menu\\Programs"); 217 CreateDirectoryA(shellpath, NULL); 218 RegSetValueExA(hkey,"Programs",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 219 //Startup 220 strcat(shellpath, "\\Startup"); 135 221 CreateDirectoryA(shellpath, NULL); 136 222 RegSetValueExA(hkey,"Startup",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 137 strcpy(shellpath, InternalGetWindowsDirectoryA()); 138 strcat(shellpath, "\\Desktop"); 139 CreateDirectoryA(shellpath, NULL); 140 RegSetValueExA(hkey,"Desktop",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 141 strcpy(shellpath, InternalGetWindowsDirectoryA()); 142 strcat(shellpath, "\\Start Menu\\Programs"); 143 CreateDirectoryA(shellpath, NULL); 144 RegSetValueExA(hkey,"Programs",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 145 strcpy(shellpath, InternalGetWindowsDirectoryA()); 146 strcat(shellpath, "\\Fonts"); 147 CreateDirectoryA(shellpath, NULL); 148 RegSetValueExA(hkey,"Fonts",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 149 strcpy(shellpath, InternalGetWindowsDirectoryA()); 150 strcat(shellpath, "\\SendTo"); 151 CreateDirectoryA(shellpath, NULL); 152 RegSetValueExA(hkey,"SendTo",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 153 strcpy(shellpath, InternalGetWindowsDirectoryA()); 154 strcat(shellpath, "\\Start Menu"); 155 CreateDirectoryA(shellpath, NULL); 156 RegSetValueExA(hkey,"Start Menu",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 223 //ShellNew 157 224 strcpy(shellpath, InternalGetWindowsDirectoryA()); 158 225 strcat(shellpath, "\\ShellNew"); 159 226 CreateDirectoryA(shellpath, NULL); 160 227 RegSetValueExA(hkey,"Templates",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 161 strcpy(shellpath, InternalGetWindowsDirectoryA());162 strcat(shellpath, "\\Recent");163 CreateDirectoryA(shellpath, NULL);164 RegSetValueExA(hkey,"Recent",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);165 strcpy(shellpath, InternalGetWindowsDirectoryA());166 strcat(shellpath, "\\NetHood");167 CreateDirectoryA(shellpath, NULL);168 RegSetValueExA(hkey,"NetHood",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);169 strcpy(shellpath, InternalGetWindowsDirectoryA());170 strcat(shellpath, "\\My Documents");171 CreateDirectoryA(shellpath, NULL);172 RegSetValueExA(hkey,"Personal",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);173 228 // } 174 229 RegCloseKey(hkey); -
trunk/src/kernel32/initterm.cpp
r3375 r3461 1 /* $Id: initterm.cpp,v 1.4 0 2000-04-14 22:35:27sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.41 2000-04-29 18:26:59 sandervl Exp $ */ 2 2 3 3 /* … … 48 48 #include <windllbase.h> 49 49 #include "winexepe2lx.h" 50 #include "initsystem.h"51 50 #include <exitlist.h> 52 51 #include "oslibdos.h" 52 #include <cpuhlp.h> 53 53 54 #define DBG_LOCALLOG DBG_initterm 54 55 #include "dbglocal.h" … … 170 171 ulSysinfo = 1; 171 172 172 InitSystem Environment(ulSysinfo);173 InitSystemInfo(ulSysinfo); 173 174 break; 174 175 } -
trunk/src/kernel32/unicode.cpp
r2803 r3461 1 /* $Id: unicode.cpp,v 1.2 2 2000-02-16 14:25:45sandervl Exp $ */1 /* $Id: unicode.cpp,v 1.23 2000-04-29 18:26:59 sandervl Exp $ */ 2 2 3 3 /* … … 77 77 */ 78 78 INT WINAPI MultiByteToWideChar(UINT page, DWORD flags, 79 LPCSTR src, INT srclen,80 79 LPCSTR src, INT srclen, 80 LPWSTR dst, INT dstlen) 81 81 { 82 82 int ret; 83 83 84 dprintf2(("MultiByteToWideChar: %d %x (%s %d) (%x %d)", page, flags, src, srclen, dst, dstlen)); 84 85 if (srclen == -1) 85 srclen = lstrlenA(src)+1;86 srclen = lstrlenA(src)+1; 86 87 if (!dstlen || !dst) 87 return srclen;88 return srclen; 88 89 89 90 ret = srclen; 90 91 while (srclen && dstlen) { 91 *dst = (WCHAR)(unsigned char)*src;92 dst++; src++;93 dstlen--; srclen--;92 *dst = (WCHAR)(unsigned char)*src; 93 dst++; src++; 94 dstlen--; srclen--; 94 95 } 95 96 if (!dstlen && srclen) { 96 SetLastError(ERROR_INSUFFICIENT_BUFFER);97 return 0;97 SetLastError(ERROR_INSUFFICIENT_BUFFER); 98 return 0; 98 99 } 99 100 return ret; … … 141 142 int dont_copy= (dstlen==0); 142 143 144 dprintf2(("WideCharToMultiByte: %d %x (%x %d) (%x %d)", page, flags, src, srclen, dst, dstlen)); 145 143 146 if ((!src) || ((!dst) && (!dont_copy)) ) 144 { SetLastError(ERROR_INVALID_PARAMETER); 145 return 0; 147 { 148 SetLastError(ERROR_INVALID_PARAMETER); 149 return 0; 146 150 } 147 151 … … 161 165 while(srclen && (dont_copy || dstlen)) 162 166 { 163 if(!dont_copy){164 if(*src<256)165 *dst = *src;166 else167 {168 /* ??? The WC_DEFAULTCHAR flag only gets used in169 * combination with the WC_COMPOSITECHECK flag or at170 * least this is what it seems from using the function171 * on NT4.0 in combination with reading the documentation.172 */173 *dst = defchar ? *defchar : '?';174 if(used)*used=1;175 }176 dstlen--;177 dst++;178 179 count++;180 srclen--;181 if((!*src) && care_for_eos) {182 eos = 1;183 break;184 }185 src++;167 if(!dont_copy){ 168 if(*src<256) 169 *dst = *src; 170 else 171 { 172 /* ??? The WC_DEFAULTCHAR flag only gets used in 173 * combination with the WC_COMPOSITECHECK flag or at 174 * least this is what it seems from using the function 175 * on NT4.0 in combination with reading the documentation. 176 */ 177 *dst = defchar ? *defchar : '?'; 178 if(used)*used=1; 179 } 180 dstlen--; 181 dst++; 182 } 183 count++; 184 srclen--; 185 if((!*src) && care_for_eos) { 186 eos = 1; 187 break; 188 } 189 src++; 186 190 } 187 191 if (dont_copy) 188 return count;192 return count; 189 193 190 194 if (!eos && srclen > 0) { 191 SetLastError(ERROR_INSUFFICIENT_BUFFER);192 return 0;195 SetLastError(ERROR_INSUFFICIENT_BUFFER); 196 return 0; 193 197 } 194 198 return count;
Note:
See TracChangeset
for help on using the changeset viewer.