Changeset 4347 for trunk/src/win32k/test
- Timestamp:
- Oct 1, 2000, 4:58:21 AM (25 years ago)
- Location:
- trunk/src/win32k/test
- Files:
-
- 2 added
- 3 edited
-
. (modified) (1 prop)
-
.cvsignore (added)
-
TstProcessReadWrite.c (added)
-
fake.c (modified) (12 diffs)
-
fakea.asm (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/test
-
Property svn:ignore
set to
TstFaker.c
-
Property svn:ignore
set to
-
trunk/src/win32k/test/fake.c
r4227 r4347 1 /* $Id: fake.c,v 1. 3 2000-09-08 21:34:12bird Exp $1 /* $Id: fake.c,v 1.4 2000-10-01 02:58:21 bird Exp $ 2 2 * 3 3 * Fake stubs for the ldr and kernel functions we imports or overloads. … … 62 62 * Pointer to the loader semaphore. 63 63 */ 64 KSEMMTX fakeL DRSem;64 KSEMMTX fakeLdrSem; 65 65 66 66 CHAR szBeginLibPath[1024]; … … 144 144 * Loader semaphore 145 145 */ 146 fakeKSEMInit((PKSEM)(void*)&fakeL DRSem, KSEM_MUTEX, KSEM_DEFAULT);146 fakeKSEMInit((PKSEM)(void*)&fakeLdrSem, KSEM_MUTEX, KSEM_DEFAULT); 147 147 148 148 /* … … 335 335 flObj = flObj; 336 336 pMTE = pMTE; 337 return 0; 337 338 } 338 339 … … 583 584 DUMMY(); 584 585 printf("fakeVMAllocMem: cbSize = 0x%08x, cbCommit = 0x%08x, flFlags1 = 0x%08x, hPTDA = 0x%04x, usVMOwnerId = 0x%04x, hMTE = 0x%04x, flFlags2 = 0x%08x, SomeArg2 = 0x%08x, pvmac = %p, rc = %d\n", 585 cbSize, cbCommit, flFlags1, hPTDA, usVMOwnerId, hMTE, flFlags2, SomeArg2, pvmac, 0); 586 cbSize, cbCommit, flFlags1, hPTDA, usVMOwnerId, hMTE, flFlags2, SomeArg2, pvmac, ERROR_NOT_SUPPORTED); 587 588 return ERROR_NOT_SUPPORTED; 589 } 590 591 592 /** 593 * @status stub 594 */ 595 APIRET KRNLCALL fakeVMFreeMem( 596 PVOID pv, 597 USHORT hPTDA, 598 ULONG flFlags 599 ) 600 { 601 DUMMY(); 602 printf("fakeVMFreeMem: pv = %p, hPTDA = 0x%04x, flFlags = %08x, rc = %d\n", 603 pv, hPTDA, flFlags, ERROR_NOT_SUPPORTED); 586 604 587 605 return ERROR_NOT_SUPPORTED; … … 628 646 629 647 648 APIRET KRNLCALL fakeVMMapDebugAlias( 649 ULONG flVMFlags, 650 ULONG ulAddress, 651 ULONG cbSize, 652 HPTDA hPTDA, 653 PVMAC pvmac) 654 { 655 printf("fakeVMMapDebugAlias: flVMFlags = 0x%08x, ulAddress = 0x%08, cbSize = 0x%08x, hPTDA = 0x%04x, pvmac = %p - not implemented\n", 656 flVMFlags, 657 ulAddress, 658 cbSize, 659 hPTDA, 660 pvmac); 661 662 return ERROR_NOT_SUPPORTED; 663 } 664 665 666 667 /** 668 * ldrOpenPath - ldrOpenPath for build 14053 and above. 669 * kernel 14053 and above. 670 * 671 * @returns OS2 return code. 672 * plv->lv_sfn is set to filename handle. 673 * @param pachFilename Pointer to modulename. Not zero terminated! 674 * @param cchFilename Modulename length. 675 * @param plv Loader local variables? (Struct from KERNEL.SDF) 676 * @param pful Pointer to flags which are passed on to ldrOpen. 677 * @param lLibPath New parameter in build 14053. 678 * ldrGetMte calls with 1 679 * ldrOpenNewExe calls with 3 680 * This is compared to the initial libpath index. 681 * The libpath index is: 682 * BEGINLIBPATH 1 683 * LIBPATH 2 684 * ENDLIBPATH 3 685 * The initial libpath index is either 1 or 2. 686 * - ignored - 687 * 688 */ 689 ULONG LDRCALL fakeldrOpenPath_new( /* retd 0x14 */ 690 PCHAR pachFilename, /* ebp + 0x08 */ 691 USHORT cchFilename, /* ebp + 0x0c */ 692 ldrlv_t * plv, /* ebp + 0x10 */ 693 PULONG pful, /* ebp + 0x14 */ 694 ULONG lLibPath /* ebp + 0x18 */ 695 ) 696 { 697 NOREF(lLibPath); 698 return fakeldrOpenPath_old(pachFilename, cchFilename, plv, pful); 699 } 700 701 630 702 /** 631 703 * myldrOpenPath - opens file eventually searching loader specific paths 704 * Pre kernel 14053. 632 705 * 633 706 * @returns OS2 return code. … … 639 712 * @status stub 640 713 */ 641 ULONG LDRCALL fakeldrOpenPath (PCHAR pachFilename, USHORT cchFilename, ldrlv_t *plv, PULONG pful)714 ULONG LDRCALL fakeldrOpenPath_old(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *plv, PULONG pful) 642 715 { 643 716 static char szPath[1024]; /* Path buffer. Used to store pathlists. 1024 should be enough */ … … 784 857 ULONG LDRCALL fakeLDRClearSem(void) 785 858 { 786 return fakeKSEMReleaseMutex(&fakeL DRSem);859 return fakeKSEMReleaseMutex(&fakeLdrSem); 787 860 } 788 861 … … 1033 1106 1034 1107 /** 1108 * Copy user memory to user memory. 1109 * @returns OS/2 return code. (NO_ERROR is success) 1110 * @param pvUsr Pointer to target (user) data area. 1111 * @param pv Pointer to source (user) data area. 1112 * @param cb Count of bytes to copy. 1113 * @param fl Flags. 1114 * @status Partially implemented. 1115 * @remark Ignores fl. Crashes on error. 1116 */ 1117 ULONG KRNLCALL fakeTKSuFuBuff(PVOID pvTarget, PVOID pvSource, ULONG cb, ULONG fl) 1118 { 1119 memcpy(pvTarget, pvSource, cb); 1120 1121 printf("fakeTKSuFuBuff: pvTarget = %p, pvSource = %p, cb = 0x%08x, fl = 0x%08x, rc = %d\n", 1122 pvTarget, pvSource, cb, fl, NO_ERROR); 1123 1124 return NO_ERROR; 1125 } 1126 1127 1128 /** 1035 1129 * Validates an hMTE and gets the MTE pointer - FAKE. 1036 1130 * @returns Pointer to MTE on success. … … 1074 1168 * Take loader semaphore. 1075 1169 */ 1076 rc = KSEMRequestMutex(&fakeL DRSem, KSEM_INDEFINITE_WAIT);1170 rc = KSEMRequestMutex(&fakeLdrSem, KSEM_INDEFINITE_WAIT); 1077 1171 if (rc != NO_ERROR) 1078 1172 { … … 1390 1484 cchFilename, pachFilename, cchFilename, plv, pus); 1391 1485 1392 rc = fakeldrOpenPath(pachFilename, cchFilename, plv, SSToDS(&ful) );1486 rc = fakeldrOpenPath(pachFilename, cchFilename, plv, SSToDS(&ful), 1); 1393 1487 if (rc != NO_ERROR) 1394 1488 { … … 1807 1901 PSZ SECCALL fakeSecPathFromSFN(SFN hFile) 1808 1902 { 1809 APIRET rc;1810 1903 BOOL f32Stack = ((int)&hFile > 0x10000); 1811 1904 1812 1905 if (!f32Stack) ThunkStack16To32(); 1813 1906 1814 rc = ERROR_NOT_SUPPORTED;1815 1907 1816 1908 if (!f32Stack) ThunkStack32To16(); 1817 1909 1818 printf("fakeSecPathFromSFN: - not implemented - hFile = 0x%04x, rc = %d\n", hFile, rc); 1819 1820 return rc; 1821 } 1822 1910 printf("fakeSecPathFromSFN: - not implemented - hFile = 0x%04x\n", hFile); 1911 1912 return NULL; 1913 } 1914 1915 /** 1916 * PID to PTDA pointer. 1917 * @returns OS/2 return code. 1918 * @param pid Process Identifier. 1919 * @param ppPTDA Pointer to the PTDA-pointer variabel which is to receive 1920 * the PTDA pointer on successful return. 1921 */ 1922 ULONG KRNLCALL fakeTKPidToPTDA(PID pid, PPPTDA ppPTDA) 1923 { 1924 DUMMY(); 1925 printf("fakeTKPidToPTDA: - not implemented - pid = 0x%04x, ppPTDA=%p\n", pid, ppPTDA); 1926 return ERROR_NOT_SUPPORTED; 1927 } 1928 -
trunk/src/win32k/test/fakea.asm
r4164 r4347 1 ; $Id: fakea.asm,v 1. 2 2000-09-02 21:08:21 bird Exp $1 ; $Id: fakea.asm,v 1.3 2000-10-01 02:58:21 bird Exp $ 2 2 ; 3 3 ; Fake assembly imports. 4 4 ; 5 ; Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@ pmsc.no)5 ; Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no) 6 6 ; 7 7 ; Project Odin Software License can be found in LICENSE.TXT … … 21 21 include devhlp.inc 22 22 include os2.inc 23 include options.inc 23 24 24 25 … … 30 31 public fakeptda_start 31 32 public fakeptda_environ 33 public fakeptda_handle 32 34 public fakeptda_module 33 35 public fakeptda_ptdasem … … 37 39 public fakef_FuBuff 38 40 public fakeg_tkExecPgm 39 public fake _tkStartProcess41 public faketkStartProcess 40 42 public CalltkExecPgm 43 public _fakeldrOpenPath@20 41 44 42 45 … … 47 50 extrn _fakeLDRClearSem@0:PROC ; fake.c 48 51 extrn _fakeKSEMRequestMutex@8:PROC ; fake.c 49 extrn fakeLDRSem:BYTE ; fake.c 52 extrn _fakeldrOpenPath_old@16:PROC ; fake.c 53 extrn _fakeldrOpenPath_new@20:PROC ; fake.c 54 extrn _options:options ; d16globl.c 55 50 56 51 57 DATA16 SEGMENT … … 63 69 fakeptda_environ dw 1 ; 1 is the hardcoded HOB of the win32ktst.exe's environment. 64 70 fakeptda_ptdasem db 20 dup (0) ; PTDA semaphore - Intra-Process serialisation mutex KSEM (sg244640). 71 fakeptda_handle dw 2 ; 2 is the hardcoded HPTDA of the current process. 65 72 fakeptda_module dw 1 ; 1 is the hardcoded HMTE of the current executable module. 66 73 fakeptda_pBeginLIBPATH dd 0 ; BEGINLIBPATH not implemented. … … 261 268 ;; 262 269 ; Faker of which simply clears the loader semaphore. 263 ; @cproto none! (void _Optlink fake _tkStartProcess(void))270 ; @cproto none! (void _Optlink faketkStartProcess(void)) 264 271 ; @returns 265 272 ; @param … … 269 276 ; @sketch 270 277 ; @status 271 ; @author knut st. osmundsen (knut.stange.osmundsen@ pmsc.no)278 ; @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 272 279 ; @remark 273 fake _tkStartProcess PROC NEAR280 faketkStartProcess PROC NEAR 274 281 push ebp 275 282 mov ebp, esp … … 286 293 leave 287 294 ret 288 fake _tkStartProcess ENDP295 faketkStartProcess ENDP 289 296 290 297 … … 302 309 ; a PE-file started by pe.exe. 303 310 ; @status completely implemented. 304 ; @author knut st. osmundsen (knut.stange.osmundsen@ pmsc.no)311 ; @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 305 312 ; 306 313 ; … … 344 351 or eax, eax 345 352 jnz ftkep_ret 346 call fake _tkStartProcess; If succesfully so far. call start process.353 call faketkStartProcess ; If succesfully so far. call start process. 347 354 jmp ftkep_ret2 ; <Currently no parameters are implemented.> 348 355 … … 372 379 ; @uses eax, ecx, edx 373 380 ; @status completely implemented. 374 ; @author knut st. osmundsen (knut.stange.osmundsen@ pmsc.no)381 ; @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 375 382 ; @remark 376 383 CalltkExecPgm PROC NEAR … … 491 498 492 499 500 ;; 501 ; Wrapper for fakeldrOpenPath. 502 ; @cproto ULONG LDRCALL fakeldrOpenPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *plv, PULONG pful, ULONG lLibPath); 503 ; @returns Return of the current fakeldrOpenPath 504 ; @param pachFilename Pointer to modulename. Not zero terminated! 505 ; @param cchFilename Modulename length. 506 ; @param plv Loader local variables? (Struct from KERNEL.SDF) 507 ; @param pful Pointer to flags which are passed on to ldrOpen. 508 ; @param lLibPath New parameter in build 14053. 509 ; ldrGetMte calls with 1 510 ; ldrOpenNewExe calls with 3 511 ; This is compared to the initial libpath index. 512 ; The libpath index is: 513 ; BEGINLIBPATH 1 514 ; LIBPATH 2 515 ; ENDLIBPATH 3 516 ; The initial libpath index is either 1 or 2. 517 ; - ignored - 518 ; @uses ecx, eax, edx 519 ; @sketch 520 ; @status 521 ; @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 522 ; @remark 523 _fakeldrOpenPath@20 PROC NEAR 524 ASSUME ds:FLAT 525 ; dummy prolog. 526 push ebp 527 mov ebp, esp 528 sub esp, 10h 529 add esp, 10h 530 pop ebp 531 ; real code 532 cmp FLAT:DATA16:_options.ulBuild, 14053 533 jge new 534 jmp near ptr FLAT:CODE32:_fakeldrOpenPath_old@16 535 new: 536 jmp near ptr FLAT:CODE32:_fakeldrOpenPath_new@20 537 _fakeldrOpenPath@20 ENDP 538 493 539 494 540 CODE32 ENDS
Note:
See TracChangeset
for help on using the changeset viewer.
