Changeset 75 for trunk/src/kernel32/Fileio.cpp
- Timestamp:
- Jun 9, 1999, 4:44:52 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/Fileio.cpp
r46 r75 29 29 { 30 30 HANDLE rc; 31 int slen = 0;31 HANDLE hFile; 32 32 33 33 if(lpszName == NULL) 34 34 return(NULL); 35 35 36 dprintf(("KERNEL32: 36 dprintf(("KERNEL32: CreateFile %s\n", lpszName)); 37 37 38 38 if(strncmp(lpszName, … … 45 45 } 46 46 47 dprintf(("KERNEL32: CreateFile %s %X %X %X %X\n",47 dprintf(("KERNEL32: CreateFileA(%s,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh)\n", 48 48 lpszName, 49 49 fdwAccess, 50 50 fdwShareMode, 51 lpsa, 51 52 fdwCreate, 52 fdwAttrsAndFlags)); 53 fdwAttrsAndFlags, 54 hTemplateFile)); 53 55 54 56 rc = O32_CreateFile(lpszName, … … 70 72 hTemplateFile); 71 73 72 //@@@PH translate handle 73 74 dprintf(("KERNEL32: CreateFile returned %d\n", 74 /* @@@PH experimental Handlemanager support */ 75 if (HMHandleAllocate(&hFile, 76 rc) == NO_ERROR) 77 rc = hFile; 78 79 dprintf(("KERNEL32: CreateFile returned %08xh\n", 75 80 rc)); 76 81 … … 112 117 113 118 dprintf(("KERNEL32: FindFirstFileW: not implemented!!")); 114 dprintf(("KERNEL32: FindFirstFileW\n")); 119 115 120 astring = UnicodeToAsciiString((LPWSTR)arg1); 116 121 // rc = O32_FindFirstFile(astring, arg2); … … 146 151 DWORD WIN32API GetFileType(HANDLE file) 147 152 { 148 DWORD rc; 153 DWORD rc; 154 HFILE hFile; 149 155 150 156 /* @@@PH 1998/02/12 Handle Manager support */ … … 152 158 return (HMGetFileType(file)); 153 159 154 dprintf(("KERNEL32: GetFileType %d\n", file)); 160 /* @@@PH experimental Handlemanager support */ 161 if (HMHandleTranslateToOS2(file, 162 &hFile) == NO_ERROR) 163 file = hFile; 164 165 dprintf(("KERNEL32: GetFileType %08xh\n", 166 file)); 167 155 168 rc = O32_GetFileType(file); 156 if(rc == 0) {//bugfix 157 rc = 1; 169 if(rc == 0) 170 { 171 //bugfix 172 rc = 1; 158 173 } 159 dprintf(("KERNEL32: GetFileType returned %d\n", rc)); 174 175 dprintf(("KERNEL32: GetFileType returned %08xh\n", 176 rc)); 177 160 178 return(rc); 161 179 } … … 165 183 BY_HANDLE_FILE_INFORMATION *arg2) 166 184 { 167 DWORD rc; 168 185 DWORD rc; 186 HFILE hFile; 187 188 /* @@@PH experimental Handlemanager support */ 189 if (HMHandleTranslateToOS2(arg1, 190 &hFile) == NO_ERROR) 191 arg1 = hFile; 192 193 194 rc = O32_GetFileInformationByHandle(arg1, 195 arg2); 196 197 dprintf(("KERNEL32: GetFileInformationByHandle (%08xh) returned %08xh\n", 198 arg1, 199 rc)); 200 201 /* @@@PH irrelevant 202 if(rc == 0) 203 { 204 //might be converted _lopen handle, so go get it 205 // arg1 = ConvertHandle(arg1); 169 206 rc = O32_GetFileInformationByHandle(arg1, arg2); 170 207 dprintf(("KERNEL32: GetFileInformationByHandle (%X) returned %d\n", arg1, rc)); 171 172 if(rc == 0) {//might be converted _lopen handle, so go get it 173 // arg1 = ConvertHandle(arg1); 174 //@@@PH translate handle 175 rc = O32_GetFileInformationByHandle(arg1, arg2); 176 dprintf(("KERNEL32: GetFileInformationByHandle (%X) returned %d\n", arg1, rc)); 177 } 178 179 return(rc); 208 } 209 */ 210 211 return(rc); 180 212 } 181 213 //****************************************************************************** … … 183 215 BOOL WIN32API SetEndOfFile( HANDLE arg1) 184 216 { 185 dprintf(("KERNEL32: SetEndOfFile\n")); 186 return O32_SetEndOfFile(arg1); 187 } 188 //****************************************************************************** 189 //****************************************************************************** 190 BOOL WIN32API SetFileTime( HANDLE arg1, const FILETIME * arg2, const FILETIME * arg3, const FILETIME * arg4) 191 { 192 dprintf(("KERNEL32: SetFileTime\n")); 193 return O32_SetFileTime(arg1, arg2, arg3, arg4); 217 HFILE hFile; 218 219 /* @@@PH experimental Handlemanager support */ 220 if (HMHandleTranslateToOS2(arg1, 221 &hFile) == NO_ERROR) 222 arg1 = hFile; 223 224 dprintf(("KERNEL32: SetEndOfFile(%08xh)\n", 225 arg1)); 226 227 return O32_SetEndOfFile(arg1); 228 } 229 //****************************************************************************** 230 //****************************************************************************** 231 BOOL WIN32API SetFileTime(HANDLE arg1, 232 const FILETIME *arg2, 233 const FILETIME *arg3, 234 const FILETIME *arg4) 235 { 236 HFILE hFile; 237 238 /* @@@PH experimental Handlemanager support */ 239 if (HMHandleTranslateToOS2(arg1, 240 &hFile) == NO_ERROR) 241 arg1 = hFile; 242 243 dprintf(("KERNEL32: SetFileTime(%08xh,%08xh,%08xh,%08xh)\n", 244 arg1, 245 arg2, 246 arg3, 247 arg4)); 248 249 return O32_SetFileTime(arg1, 250 arg2, 251 arg3, 252 arg4); 194 253 } 195 254 //****************************************************************************** … … 227 286 DWORD WIN32API GetFileSize( HANDLE arg1, PDWORD arg2) 228 287 { 229 dprintf(("KERNEL32: GetFileSize\n")); 230 return O32_GetFileSize(arg1, arg2); 288 HFILE hFile; 289 290 /* @@@PH experimental Handlemanager support */ 291 if (HMHandleTranslateToOS2(arg1, 292 &hFile) == NO_ERROR) 293 arg1 = hFile; 294 295 dprintf(("KERNEL32: GetFileSize (%08xh, %08xh)\n", 296 arg1, 297 arg2)); 298 299 return O32_GetFileSize(arg1, 300 arg2); 231 301 } 232 302 //****************************************************************************** … … 298 368 //****************************************************************************** 299 369 //****************************************************************************** 300 BOOL WIN32API ReadFile( HANDLE arg1, PVOID arg2, DWORD arg3, PDWORD arg4, LPOVERLAPPED arg5) 301 { 302 BOOL rc; 370 BOOL WIN32API ReadFile(HANDLE arg1, 371 PVOID arg2, 372 DWORD arg3, 373 PDWORD arg4, 374 LPOVERLAPPED arg5) 375 { 376 BOOL rc; 377 HFILE hFile; 303 378 304 379 /* @@@PH 1998/02/12 Handle Manager support */ … … 306 381 return (HMReadFile(arg1, arg2, arg3, arg4, arg5)); 307 382 308 rc = O32_ReadFile(arg1, arg2, arg3, arg4, arg5); 309 dprintf(("KERNEL32: ReadFile %X %d bytes returned %d\n", arg1, arg3, rc)); 383 /* @@@PH 1999/06/09 Handle Manager support */ 384 385 /* @@@PH experimental Handlemanager support */ 386 if (HMHandleTranslateToOS2(arg1, 387 &hFile) == NO_ERROR) 388 arg1 = hFile; 389 390 rc = O32_ReadFile(arg1, 391 arg2, 392 arg3, 393 arg4, 394 arg5); 395 396 dprintf(("KERNEL32: ReadFile %X %d bytes returned %d\n", 397 arg1, 398 arg3, 399 rc)); 400 310 401 return(rc); 311 402 } … … 317 408 DWORD dwMoveMethod) 318 409 { 319 //// dprintf(("KERNEL32: SetFilePointer\n")); 320 321 //@@@PH translate handle 322 410 HANDLE hFile2; 411 412 // dprintf(("KERNEL32: SetFilePointer\n")); 413 414 /* @@@PH experimental Handlemanager support */ 415 if (HMHandleTranslateToOS2(hFile, 416 &hFile2) == NO_ERROR) 417 hFile = hFile2; 323 418 324 419 return(O32_SetFilePointer(hFile, 325 lDistanceToMove,326 lpDistanceToMoveHigh,327 dwMoveMethod));420 lDistanceToMove, 421 lpDistanceToMoveHigh, 422 dwMoveMethod)); 328 423 } 329 424 //****************************************************************************** … … 335 430 LPOVERLAPPED lpOverlapped) 336 431 { 337 BOOL rc; 432 BOOL rc; 433 HANDLE hFile2; 338 434 339 435 //@@@PH translate handle … … 352 448 nrbyteswritten, 353 449 lpOverlapped)); 450 451 /* @@@PH experimental Handlemanager support */ 452 if (HMHandleTranslateToOS2(hFile, 453 &hFile2) == NO_ERROR) 454 hFile = hFile2; 455 354 456 355 457 rc = O32_WriteFile(hFile, buffer, nrbytes, nrbyteswritten, (LPOVERLAPPED)lpOverlapped); … … 476 578 //****************************************************************************** 477 579 //****************************************************************************** 478 BOOL WIN32API LockFile( HANDLE arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5) 479 { 480 dprintf(("KERNEL32: LockFile\n")); 481 return O32_LockFile(arg1, arg2, arg3, arg4, arg5); 580 BOOL WIN32API LockFile(HANDLE arg1, 581 DWORD arg2, 582 DWORD arg3, 583 DWORD arg4, 584 DWORD arg5) 585 { 586 HFILE hFile; 587 588 /* @@@PH experimental Handlemanager support */ 589 if (HMHandleTranslateToOS2(arg1, 590 &hFile) == NO_ERROR) 591 arg1 = hFile; 592 593 dprintf(("KERNEL32: LockFile (%08xh,%08xh,%08xh,%08xh,%08xh)\n", 594 arg1, 595 arg2, 596 arg3, 597 arg4, 598 arg5)); 599 600 return O32_LockFile(arg1, 601 arg2, 602 arg3, 603 arg4, 604 arg5); 482 605 } 483 606 … … 501 624 502 625 BOOL WIN32API LockFileEx(HANDLE hFile, 503 DWORD dwFlags, 504 DWORD dwReserved, 505 DWORD nNumberOfBytesToLockLow, 506 DWORD nNumberOfBytesToLockHigh, 507 LPOVERLAPPED LPOVERLAPPED) 508 { 626 DWORD dwFlags, 627 DWORD dwReserved, 628 DWORD nNumberOfBytesToLockLow, 629 DWORD nNumberOfBytesToLockHigh, 630 LPOVERLAPPED LPOVERLAPPED) 631 { 632 HFILE hFile2; 633 634 /* @@@PH experimental Handlemanager support */ 635 if (HMHandleTranslateToOS2(hFile, 636 &hFile2) == NO_ERROR) 637 hFile = hFile2; 638 509 639 dprintf(("Kernel32: LockFileEx(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh)\n", 510 640 hFile, … … 593 723 arg2, 594 724 arg3); 725 726 /* @@@PH 1999/06/09 HandleManager support temporarily disabled */ 595 727 if (hFile != 0) /* check if handle is valid */ 596 728 { … … 598 730 hFile) == NO_ERROR) 599 731 return (ulWindowsHandle); 600 else601 return (0);602 732 } 603 else 604 return (0); 605 } 606 //****************************************************************************** 607 //****************************************************************************** 608 BOOL WIN32API UnlockFile( HANDLE arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5) 609 { 610 dprintf(("KERNEL32: UnlockFile\n")); 611 return O32_UnlockFile(arg1, arg2, arg3, arg4, arg5); 733 734 return (hFile); 735 } 736 //****************************************************************************** 737 //****************************************************************************** 738 BOOL WIN32API UnlockFile(HANDLE arg1, 739 DWORD arg2, 740 DWORD arg3, 741 DWORD arg4, 742 DWORD arg5) 743 { 744 HFILE hFile2; 745 746 /* @@@PH experimental Handlemanager support */ 747 if (HMHandleTranslateToOS2(arg1, 748 &hFile2) == NO_ERROR) 749 arg1 = hFile2; 750 751 dprintf(("KERNEL32: UnlockFile(%08xh,%08xh,%08xh,%08xh,%08xh)\n", 752 arg1, 753 arg2, 754 arg3, 755 arg4, 756 arg5)); 757 758 return O32_UnlockFile(arg1, 759 arg2, 760 arg3, 761 arg4, 762 arg5); 612 763 } 613 764 … … 630 781 631 782 BOOL WIN32API UnlockFileEx(HANDLE hFile, 632 DWORD dwReserved, 633 DWORD nNumberOfBytesToLockLow, 634 DWORD nNumberOfBytesToLockHigh, 635 LPOVERLAPPED LPOVERLAPPED) 636 { 783 DWORD dwReserved, 784 DWORD nNumberOfBytesToLockLow, 785 DWORD nNumberOfBytesToLockHigh, 786 LPOVERLAPPED LPOVERLAPPED) 787 { 788 HFILE hFile2; 789 790 /* @@@PH experimental Handlemanager support */ 791 if (HMHandleTranslateToOS2(hFile, 792 &hFile2) == NO_ERROR) 793 hFile = hFile2; 794 637 795 dprintf(("Kernel32: UnlockFileEx(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh)\n", 638 796 hFile, … … 692 850 BOOL WIN32API FindNextChangeNotification(HANDLE hChange) 693 851 { 694 dprintf(("KERNEL32: FindNextChangeNotification, Not implemented\n")); 852 dprintf(("KERNEL32: FindNextChangeNotification (%08xh), Not implemented\n", 853 hChange)); 854 695 855 return(0); 696 856 } … … 718 878 719 879 DWORD WIN32API GetCompressedFileSizeA(LPCTSTR lpFileName, 720 880 LPDWORD lpFileSizeHigh) 721 881 { 722 882 dprintf(("KERNEL32: GetCompressedFileSizeA (%s, %08xh) not implemented.\n",
Note:
See TracChangeset
for help on using the changeset viewer.