Changeset 75337 in vbox for trunk/src/VBox/Additions/os2/VBoxSF/VBoxSFA.asm
- Timestamp:
- Nov 9, 2018 1:39:01 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/os2/VBoxSF/VBoxSFA.asm
r69339 r75337 30 30 31 31 32 ;******************************************************************************* 33 ;* Header Files*34 ;******************************************************************************* 32 ;********************************************************************************************************************************* 33 ;* Header Files * 34 ;********************************************************************************************************************************* 35 35 %define RT_INCL_16BIT_SEGMENTS 36 36 %include "iprt/asmdefs.mac" 37 37 %include "iprt/err.mac" 38 %include "iprt/x86.mac" 39 %include "iprt/formats/dwarf.mac" 38 40 %include "VBox/VBoxGuest.mac" 39 41 40 42 41 ;******************************************************************************* 42 ;* Defined Constants And Macros * 43 ;******************************************************************************* 43 ;********************************************************************************************************************************* 44 ;* Dwarf constants and macros * 45 ;********************************************************************************************************************************* 46 ;; enable dwarf debug info 47 %define WITH_DWARF 1 48 49 ;; Emits a LEB128 (signed) constant (%1) - limited range. 50 %macro DWARF_LEB128 1 51 %if %1 >= 0 52 %if %1 < 64 53 db %1 54 %else 55 db (%1 & 0x7f) | 0x80 56 db (%1 >> 7) & 0x7f 57 %endif 58 %else 59 %if %1 > -64 60 db (%1 & 0x3f) | 0x40 61 %else 62 db (%1 & 0x7f) | 0x80 63 db ((%1 >> 7) & 0x7f) | 0x40 64 %endif 65 %endif 66 %endmacro 67 68 ;; Emits a ULEB128 (unsigned) constant (%1) - limited range. 69 %macro DWARF_ULEB128 1 70 %if %1 < 0x80 71 db %1 72 %elif %1 < 0x4000 73 db (%1 & 0x7f) | 0x80 74 db (%1 >> 7) 75 %elif %1 < 0x200000 76 db ((%1) & 0x7f) | 0x80 77 db ((%1 >> 7) & 0x7f) | 0x80 78 db ((%1 >> 14)) 79 %else 80 %error out of range: %1 81 %endif 82 %endmacro 83 84 ;; Emits a pair of ULEB128 constants. Useful for .debug_abbrev. 85 %macro DWARF_ULEB128_PAIR 2 86 DWARF_ULEB128 %1 87 DWARF_ULEB128 %2 88 %endmacro 89 90 91 ;; defines a CFA offset by register (%1) + unsigned offset (%2). 92 %macro CFA_DEF_CFA 2 93 db DW_CFA_def_cfa 94 DWARF_ULEB128 %1 95 DWARF_ULEB128 %2 96 %endmacro 97 98 ;; defines the register (%1) value as CFA + unsigned offset (%2) * data_alignment_factor. 99 %macro CFA_VAL_OFFSET 2 100 db DW_CFA_val_offset 101 DWARF_ULEB128 %1 102 DWARF_ULEB128 %2 103 %endmacro 104 105 ;; defines the register (%1) save location as CFA + unsigned offset (%2) * data_alignment_factor. 106 %macro CFA_OFFSET 2 107 %if %1 < 0x40 108 db DW_CFA_offset | %1 109 %else 110 db DW_CFA_offset_extended 111 DWARF_ULEB128 %1 112 %endif 113 DWARF_ULEB128 %2 114 %endmacro 115 116 %define MY_ABBREV_CODE_CU 2 117 %define MY_ABBREV_CODE_LABEL 3 118 119 120 ;; Emits a debug info for a label in CODE16. 121 ;; @param %1 symbol 122 %macro DWARF_LABEL_CODE16 1 123 %ifdef WITH_DWARF 124 segment _debug_info 125 DWARF_ULEB128 MY_ABBREV_CODE_LABEL 126 dd %1 wrt CODE16 127 db 2 ; Hardcoded CODE16 number. 128 %defstr tmp_str_conversion %1 129 db tmp_str_conversion, 0 130 %endif 131 segment CODE16 132 %endmacro 133 134 135 ;; Emits a debug info for a label in CODE32. 136 ;; @param %1 symbol 137 %macro DWARF_LABEL_TEXT32 1 138 %ifdef WITH_DWARF 139 segment _debug_info 140 DWARF_ULEB128 MY_ABBREV_CODE_LABEL 141 dd %1 wrt TEXT32 142 db 3 ; Hardcoded TEXT32 number. 143 %defstr tmp_str_conversion %1 144 db tmp_str_conversion, 0 145 %endif 146 segment TEXT32 147 %endmacro 148 149 150 151 ;********************************************************************************************************************************* 152 ;* Additional Segment definitions. * 153 ;********************************************************************************************************************************* 154 %ifdef WITH_DWARF ; We need to use '_debug_xxx' + dotseg.exe here rather than '.debug_xxx' because some nasm crap. 155 segment _debug_frame public CLASS=DWARF align=4 use32 156 g_cie_thunk_back: 157 dd (g_cie_thunk_end - g_cie_thunk_back - 4) ; Length 158 dd 0xffffffff ; I'm a CIE. 159 db 4 ; DwARF v4 160 db 0 ; Augmentation. 161 db 4 ; Address size. 162 db 4 ; Segment size. 163 DWARF_LEB128 1 ; Code alignment factor. 164 DWARF_LEB128 -1 ; Data alignment factor. 165 DWARF_ULEB128 DWREG_X86_RA ; Return register column. 166 CFA_DEF_CFA DWREG_X86_EBP, 8 ; cfa = EBP + 8 167 CFA_OFFSET DWREG_X86_EBP, 8 ; EBP = [CFA - 8] 168 CFA_OFFSET DWREG_X86_ESP, 8+10 ; SS = [CFA - 8 - 10] 169 CFA_OFFSET DWREG_X86_SS, 8+6 ; SS = [CFA - 8 - 6] 170 CFA_OFFSET DWREG_X86_ES, 8+4 ; ES = [CFA - 8 - 4] 171 CFA_OFFSET DWREG_X86_DS, 8+2 ; DS = [CFA - 8 - 2] 172 CFA_OFFSET DWREG_X86_CS, 2 ; CS = [CFA - 2] 173 ; CFA_OFFSET DWREG_X86_RA, 4 ; RetAddr = [CFA - 4] 174 align 4, db DW_CFA_nop 175 g_cie_thunk_end: 176 177 178 segment _debug_abbrev public CLASS=DWARF align=1 use32 179 g_abbrev_compile_unit: 180 DWARF_ULEB128 MY_ABBREV_CODE_CU 181 DWARF_ULEB128_PAIR DW_TAG_compile_unit, DW_CHILDREN_yes 182 DWARF_ULEB128_PAIR DW_AT_name, DW_FORM_string 183 db 0, 0 ; the end. 184 g_abbrev_label: 185 db MY_ABBREV_CODE_LABEL 186 DWARF_ULEB128_PAIR DW_TAG_label, DW_CHILDREN_no 187 DWARF_ULEB128_PAIR DW_AT_low_pc, DW_FORM_addr 188 DWARF_ULEB128_PAIR DW_AT_segment, DW_FORM_data1 189 DWARF_ULEB128_PAIR DW_AT_name, DW_FORM_string 190 db 0, 0 ; the end. 191 192 193 segment _debug_info public CLASS=DWARF align=1 use32 194 g_dwarf_compile_unit_header: 195 dd g_dwarf_compile_unit_end - g_dwarf_compile_unit_header - 4 196 dw 2 ; DWARF v2 197 dd g_abbrev_compile_unit wrt _debug_abbrev 198 db 4 ; address_size 199 .compile_unit_die: 200 db MY_ABBREV_CODE_CU 201 db __FILE__, 0 202 203 segment TEXT32 204 %endif ; WITH_DWARF 205 206 207 208 ;********************************************************************************************************************************* 209 ;* Defined Constants And Macros * 210 ;********************************************************************************************************************************* 44 211 %define ERROR_NOT_SUPPORTED 50 45 212 %define ERROR_INVALID_PARAMETER 87 46 213 %define DevHlp_AttachDD 2ah 214 47 215 48 216 ;; … … 53 221 %%my_dbg_str: db %1, 0ah, 0 54 222 segment CODE16 55 push ax56 mov ax, %%my_dbg_str57 call NAME(dbgstr16)58 pop ax223 push ax 224 mov ax, %%my_dbg_str 225 call NAME(dbgstr16) 226 pop ax 59 227 %endif 60 228 %endmacro 61 229 230 ;%define RT_STR_QUOTE " 231 ;%define RT_STR(a_Label) RT_STR_QUOTE a_Label RT_STR_QUOTE 62 232 63 233 %macro VBOXSF_EP16_BEGIN 2 234 DWARF_LABEL_CODE16 %1 64 235 global %1 65 236 %1: 66 DEBUG_STR16 {'VBoxSF: ', %2}237 ;DEBUG_STR16 {'VBoxSF: ', %2} 67 238 68 239 %endmacro … … 74 245 75 246 ;; 76 ; Used totaking us to 32-bit and reserving a parameter frame.247 ; Used in a 16-bit entrypoint for taking us to 32-bit and reserving a parameter frame. 77 248 ; 78 249 ; @param %1 The function name … … 80 251 ; 81 252 %macro VBOXSF_TO_32 2 82 ; prologue 83 push ebp 84 mov ebp, esp ; bp 85 push ds ; bp - 2 86 push es ; bp - 4 87 88 ; Reserve the 32-bit parameter and align the stack on a 16 byte 89 ; boundary to make GCC really happy. 90 sub sp, %2 91 and sp, 0fff0h 92 93 ;jmp far dword NAME(%i %+ _32) wrt FLAT 94 db 066h 95 db 0eah 96 dd NAME(%1 %+ _32) ;wrt FLAT 97 dw TEXT32 wrt FLAT 253 ; prologue 254 %ifdef DEBUG 255 %ifndef WITH_DWARF 256 inc ebp 257 %endif 258 %endif 259 push ebp 260 mov ebp, esp ; bp 261 push ds ; bp - 2 262 push es ; bp - 4 263 %ifdef WITH_DWARF 264 push ss ; bp - 6 265 lea eax, [esp + 3*2 + 4 + 4] ; bp - 10: return esp (16-bit) 266 push eax 267 %endif 268 269 ; Reserve the 32-bit parameter and align the stack on a 16 byte 270 ; boundary to make GCC really happy. 271 sub sp, %2 272 and sp, 0fff0h 273 274 ;jmp far dword NAME(%i %+ _32) wrt FLAT 275 db 066h 276 db 0eah 277 dd NAME(%1 %+ _32) ;wrt FLAT 278 dw TEXT32 wrt FLAT 98 279 segment TEXT32 99 280 GLOBALNAME %1 %+ _32 100 mov ax, DATA32 wrt FLAT 101 mov ds, ax 102 mov es, ax 103 104 call KernThunkStackTo32 105 106 %endmacro VBOXSF_TO_32 1 281 DWARF_LABEL_TEXT32 NAME(%1 %+ _32) 282 mov ax, DATA32 wrt FLAT 283 mov ds, ax 284 mov es, ax 285 286 call KernThunkStackTo32 287 .vboxsf_to_32_end: 288 289 %endmacro ; VBOXSF_TO_32 107 290 108 291 ;; … … 112 295 ; 113 296 %macro VBOXSF_TO_16 1 114 push eax 115 call KernThunkStackTo16 116 pop eax 117 118 ;jmp far dword NAME(%1 %+ _16) wrt CODE16 119 db 066h 120 db 0eah 121 dw NAME(%1 %+ _16) wrt CODE16 122 dw CODE16 297 .vboxsf_to_16_start: 298 push eax 299 call KernThunkStackTo16 300 pop eax 301 302 ;jmp far dword NAME(%1 %+ _16) wrt CODE16 303 db 066h 304 db 0eah 305 dw NAME(%1 %+ _16) wrt CODE16 306 dw CODE16 307 .vboxsf_to_16_done_32: 308 %ifdef WITH_DWARF 309 segment _debug_frame 310 .fde_start: 311 dd (.fde_end - .fde_start) - 4 312 dd g_cie_thunk_back wrt _debug_frame 313 dd 2 ; TEXT32 idx 314 dd NAME(%1 %+ _32) wrt TEXT32 315 dd .vboxsf_to_16_done_32 - NAME(%1 %+ _32) 316 db DW_CFA_advance_loc | 4 317 db DW_CFA_advance_loc | 2 318 db DW_CFA_advance_loc | 2 319 db DW_CFA_advance_loc | 5 320 db DW_CFA_advance_loc2 ; Hack to easily cover the parameter conversion code. 321 dw .vboxsf_to_16_start - .vboxsf_to_32_end 322 db DW_CFA_advance_loc | 1 323 db DW_CFA_advance_loc | 5 324 db DW_CFA_advance_loc | 1 325 db DW_CFA_advance_loc | 6 326 align 4, db DW_CFA_nop 327 .fde_end: 328 %endif ; WITH_DWARF 123 329 segment CODE16 124 330 GLOBALNAME %1 %+ _16 125 126 ; Epilogue 127 lea sp, [bp - 4h] 128 pop es 129 pop ds 130 mov esp, ebp 131 pop ebp 331 DWARF_LABEL_CODE16 NAME(%1 %+ _16) 332 333 ; Epilogue 334 lea sp, [bp - 4h] 335 pop es 336 pop ds 337 mov esp, ebp 338 pop ebp 339 %ifdef DEBUG 340 %ifndef WITH_DWARF 341 dec ebp 342 %endif 343 %endif 132 344 %endmacro 133 345 134 346 ;; 135 ; Thunks the given 16:16 pointer to a flat pointer .136 ; 137 ; @param %1 The negatedebp offset of the input.347 ; Thunks the given 16:16 pointer to a flat pointer, NULL is returned as NULL. 348 ; 349 ; @param %1 The ebp offset of the input. 138 350 ; @param %2 The esp offset of the output. 139 351 ; @users eax, edx, ecx 140 352 ; 141 353 %macro VBOXSF_FARPTR_2_FLAT 2 142 movzx eax, word [ebp - (%1) + 2] 143 push eax 144 call KernSelToFlat 145 movzx edx, word [ebp - (%1)] 146 add eax, edx 147 mov [esp + (%2)], eax 354 push dword [ebp + (%1)] 355 call KernSelToFlat 356 add esp, 4h 357 mov [esp + (%2)], eax 148 358 %endmacro 149 359 … … 151 361 ; Thunks the given 16:16 struct sffsd pointer to a flat pointer. 152 362 ; 153 ; @param %1 The negatedebp offset of the input.363 ; @param %1 The ebp offset of the input. 154 364 ; @param %2 The esp offset of the output. 155 365 ; @users eax, ecx 156 366 ; 157 367 %macro VBOXSF_PSFFSD_2_FLAT 2 158 lds cx, [ebp - (%1)] 159 and ecx, 0ffffh 160 mov eax, dword [ecx] 161 mov cx, DATA32 wrt FLAT 162 mov [esp + (%2)], eax 163 mov ds, cx 368 %if 1 ; optimize later if we can. 369 VBOXSF_FARPTR_2_FLAT %1, %2 370 %else 371 lds cx, [ebp + (%1)] 372 and ecx, 0ffffh 373 mov eax, dword [ecx] 374 mov cx, DATA32 wrt FLAT 375 mov [esp + (%2)], eax 376 mov ds, cx 377 %endif 164 378 %endmacro 165 379 … … 168 382 ; Thunks the given 16:16 struct cdfsd pointer to a flat pointer. 169 383 ; 170 ; @param %1 The negatedebp offset of the input.384 ; @param %1 The ebp offset of the input. 171 385 ; @param %2 The esp offset of the output. 172 386 ; @users eax, ecx 173 387 ; 174 388 %macro VBOXSF_PCDFSD_2_FLAT 2 175 lds cx, [ebp - (%1)] 176 and ecx, 0ffffh 177 mov eax, dword [ecx] 178 mov cx, DATA32 wrt FLAT 179 mov [esp + (%2)], eax 180 mov ds, cx 389 %if 1 ; optimize later if possible. 390 VBOXSF_FARPTR_2_FLAT %1, %2 391 %else 392 lds cx, [ebp + (%1)] 393 and ecx, 0ffffh 394 mov eax, dword [ecx] 395 mov cx, DATA32 wrt FLAT 396 mov [esp + (%2)], eax 397 mov ds, cx 398 %endif 181 399 %endmacro 182 400 … … 184 402 ; Thunks the given 16:16 struct fsfsd pointer to a flat pointer. 185 403 ; 186 ; @param %1 The negatedebp offset of the input.404 ; @param %1 The ebp offset of the input. 187 405 ; @param %2 The esp offset of the output. 188 406 ; @users eax, ecx 189 407 ; 190 408 %macro VBOXSF_PFSFSD_2_FLAT 2 191 lds cx, [ebp - (%1)] 192 and ecx, 0ffffh 193 mov eax, dword [ecx] 194 mov cx, DATA32 wrt FLAT 195 mov [esp + (%2)], eax 196 mov ds, cx 409 %if 1 ; optimize later if possible. 410 VBOXSF_FARPTR_2_FLAT %1, %2 411 %else 412 lds cx, [ebp + (%1)] 413 and ecx, 0ffffh 414 mov eax, dword [ecx] 415 mov cx, DATA32 wrt FLAT 416 mov [esp + (%2)], eax 417 mov ds, cx 418 %endif 197 419 %endmacro 198 420 199 421 200 201 ;******************************************************************************* 202 ;* External Symbols * 203 ;******************************************************************************* 422 ;; 423 ; Used for taking us from 32-bit and reserving a parameter frame. 424 ; 425 ; @param %1 The function name 426 ; @param %2 The number of bytes to reserve 427 ; 428 %macro VBOXSF_FROM_32 2 429 ; prologue 430 push ebp 431 mov ebp, esp ; ebp 432 push ds ; ebp - 4 433 push es ; ebp - 8 434 push ebx ; ebp - 0ch 435 push esi ; ebp - 10h 436 push edi ; ebp - 14h 437 438 ; Reserve the 32-bit parameter 439 sub esp, %2 440 441 call KernThunkStackTo16 442 443 ;jmp far dword NAME(%1 %+ _16) wrt CODE16 444 db 066h 445 db 0eah 446 dw NAME(%1 %+ _16) wrt CODE16 447 dw CODE16 448 .vboxsf_from_32_end: 449 450 segment CODE16 451 GLOBALNAME %1 %+ _16 452 DWARF_LABEL_CODE16 NAME(%1 %+ _16) 453 454 %endmacro 455 456 457 ;; 458 ; Partially countering VBOXSF_FROM_32: 459 ; Take us back to 32-bit mode, but don't do the epilogue stuff. 460 ; 461 ; @param %1 The function name 462 ; 463 %macro VBOXSF_FROM_16_SWITCH 1 464 .vboxsf_from_16_start: 465 ;jmp far dword NAME(%i %+ _32) wrt FLAT 466 db 066h 467 db 0eah 468 dd NAME(%1 %+ _32) ;wrt FLAT 469 dw TEXT32 wrt FLAT 470 .vboxsf_from_16_done_16: 471 472 segment TEXT32 473 GLOBALNAME %1 %+ _32 474 DWARF_LABEL_TEXT32 NAME(%1 %+ _32) 475 476 push eax 477 call KernThunkStackTo32 478 mov ax, DATA32 wrt FLAT 479 mov ds, eax 480 mov es, eax 481 pop eax 482 %endmacro 483 484 485 ;; 486 ; Does the remaining recovery after VBOXSF_FROM_32. 487 ; 488 %macro VBOXSF_FROM_16_EPILOGUE 0 489 ; Epilogue 490 lea esp, [ebp - 14h] 491 pop edi 492 pop esi 493 pop ebx 494 pop es 495 pop ds 496 cld 497 mov esp, ebp 498 pop ebp 499 %endmacro 500 501 502 503 504 ;********************************************************************************************************************************* 505 ;* External Symbols * 506 ;********************************************************************************************************************************* 204 507 segment CODE32 205 508 extern KernThunkStackTo32 … … 208 511 segment CODE16 209 512 extern FSH_FORCENOSWAP 513 extern FSH_GETVOLPARM 210 514 extern DOS16WRITE 211 515 … … 252 556 extern NAME(FS32_SETSWAP) 253 557 extern NAME(FS32_SHUTDOWN) 558 extern NAME(FS32_VERIFYUNCNAME) 254 559 extern FS32_WRITE 255 560 … … 267 572 global FS_NAME 268 573 FS_NAME: 269 db 'VBOXSF',0574 db 'VBOXSF',0 270 575 271 576 ;; … … 284 589 FS_ATTRIBUTE: 285 590 FS32_ATTRIBUTE: 286 dd FSA_REMOTE + FSA_LARGEFILE ;+ FSA_LVL7+ FSA_LOCK591 dd FSA_REMOTE + FSA_LARGEFILE + FSA_UNC + FSA_LVL7 ;+ FSA_LOCK 287 592 288 593 ;; 64-bit mask. … … 291 596 global FS_MPSAFEFLAGS2 292 597 FS_MPSAFEFLAGS2: 293 dd 0294 dd 0598 dd 1 | (1<<6) 599 dd 0 295 600 296 601 ;; 297 602 ; Set after VBoxSFR0Init16Bit has been called. 298 603 GLOBALNAME g_fDoneRing0 299 db 0604 db 0 300 605 301 606 align 4 … … 304 609 ; (This is set by FS_INIT.) 305 610 GLOBALNAME g_fpfnDevHlp 306 dd 0611 dd 0 307 612 308 613 ;; 309 614 ; Whether initialization should be verbose or quiet. 310 615 GLOBALNAME g_fVerbose 311 db 1616 db 1 312 617 313 618 ;; DEBUGGING DEBUGGING 314 619 GLOBALNAME g_u32Info 315 dd 0620 dd 0 316 621 317 622 ;; Far pointer to DOS16WRITE (corrected set before called). 318 623 ; Just a 'temporary' hack to work around a wlink/nasm issue. 319 624 GLOBALNAME g_fpfnDos16Write 320 dw DOS16WRITE321 dw seg DOS16WRITE625 dw DOS16WRITE 626 dw seg DOS16WRITE 322 627 323 628 ;; 324 629 ; The attach dd data. 325 630 GLOBALNAME g_VBoxGuestAttachDD 326 dd 0327 dw 0328 dd 0329 dw 0631 dd 0 632 dw 0 633 dd 0 634 dw 0 330 635 ;; 331 636 ; The AttachDD name of the VBoxGuest.sys driver. 332 637 GLOBALNAME g_szVBoxGuestName 333 db VBOXGUEST_DEVICE_NAME_SHORT, 0638 db VBOXGUEST_DEVICE_NAME_SHORT, 0 334 639 ;; 335 640 ; The VBoxGuest IDC connection data. 336 641 GLOBALNAME g_VBoxGuestIDC 337 times VBGLOS2ATTACHDD_size db 0642 times VBGLOS2ATTACHDD_size db 0 338 643 339 644 ;; … … 341 646 segment DATA32 342 647 g_pfnDos16Write: 343 dd DOS16WRITE ; flat648 dd DOS16WRITE ; flat 344 649 345 650 … … 363 668 VBOXSF_EP16_BEGIN FS_ALLOCATEPAGESPACE, 'FS_ALLOCATEPAGESPACE' 364 669 VBOXSF_TO_32 FS_ALLOCATEPAGESPACE, 4*4 365 movzx ecx, word [ebp + 08h] ; cbWantContig366 mov [esp + 3*4], ecx367 mov edx, [ebp + 0ah] ; cb368 mov [esp + 2*4], edx369 VBOXSF_PSFFSD_2_FLAT 0eh, 1*4 ; psffsd370 VBOXSF_FARPTR_2_FLAT 12h, 0*4 ; psffsi371 call NAME(FS32_ALLOCATEPAGESPACE)670 movzx ecx, word [ebp + 08h] ; cbWantContig 671 mov [esp + 3*4], ecx 672 mov edx, [ebp + 0ah] ; cb 673 mov [esp + 2*4], edx 674 VBOXSF_PSFFSD_2_FLAT 0eh, 1*4 ; psffsd 675 VBOXSF_FARPTR_2_FLAT 12h, 0*4 ; psffsi 676 call NAME(FS32_ALLOCATEPAGESPACE) 372 677 VBOXSF_TO_16 FS_ALLOCATEPAGESPACE 373 retf 0eh678 retf 0eh 374 679 VBOXSF_EP16_END FS_ALLOCATEPAGESPACE 375 680 … … 378 683 ; 379 684 VBOXSF_EP16_BEGIN FS_ATTACH, 'FS_ATTACH' 380 ;381 ; Initialized ring-0 yet? (this is a likely first entry point)382 ;383 push ds384 mov ax, DATA16385 mov ds, ax386 test byte [NAME(g_fDoneRing0)], 1387 jnz .DoneRing0388 call NAME(VBoxSFR0Init16Bit)685 ; 686 ; Initialized ring-0 yet? (this is a likely first entry point) 687 ; 688 push ds 689 mov ax, DATA16 690 mov ds, ax 691 test byte [NAME(g_fDoneRing0)], 1 692 jnz .DoneRing0 693 call NAME(VBoxSFR0Init16Bit) 389 694 .DoneRing0: 390 pop ds695 pop ds 391 696 392 697 VBOXSF_TO_32 FS_ATTACH, 6*4 393 VBOXSF_FARPTR_2_FLAT 08h, 5*4 ; pcbParm394 VBOXSF_FARPTR_2_FLAT 0ch, 4*4 ; pszParm395 VBOXSF_FARPTR_2_FLAT 10h, 3*4 ; pcdfsd396 VBOXSF_FARPTR_2_FLAT 14h, 2*4 ; pvpfsd397 VBOXSF_FARPTR_2_FLAT 18h, 1*4 ; pszDev398 movzx ecx, word [ebp + 1ch] ; fFlag399 mov [esp], ecx400 call NAME(FS32_ATTACH)698 VBOXSF_FARPTR_2_FLAT 08h, 5*4 ; pcbParm 699 VBOXSF_FARPTR_2_FLAT 0ch, 4*4 ; pszParm 700 VBOXSF_FARPTR_2_FLAT 10h, 3*4 ; pcdfsd 701 VBOXSF_FARPTR_2_FLAT 14h, 2*4 ; pvpfsd 702 VBOXSF_FARPTR_2_FLAT 18h, 1*4 ; pszDev 703 movzx ecx, word [ebp + 1ch] ; fFlag 704 mov [esp], ecx 705 call NAME(FS32_ATTACH) 401 706 VBOXSF_TO_16 FS_ATTACH 402 retf 16h707 retf 16h 403 708 VBOXSF_EP16_END FS_ATTACH 404 709 … … 408 713 VBOXSF_EP16_BEGIN FS_CANCELLOCKREQUEST, 'FS_CANCELLOCKREQUEST' 409 714 VBOXSF_TO_32 FS_CANCELLOCKREQUEST, 3*4 410 VBOXSF_FARPTR_2_FLAT 08h, 2*4 ; pLockRange411 VBOXSF_PSFFSD_2_FLAT 0ch, 1*4 ; psffsd412 VBOXSF_FARPTR_2_FLAT 10h, 0*4 ; psffsi413 call NAME(FS32_CANCELLOCKREQUEST)715 VBOXSF_FARPTR_2_FLAT 08h, 2*4 ; pLockRange 716 VBOXSF_PSFFSD_2_FLAT 0ch, 1*4 ; psffsd 717 VBOXSF_FARPTR_2_FLAT 10h, 0*4 ; psffsi 718 call NAME(FS32_CANCELLOCKREQUEST) 414 719 VBOXSF_TO_16 FS_CANCELLOCKREQUEST 415 retf 0ch720 retf 0ch 416 721 VBOXSF_EP16_END FS_CANCELLOCKREQUEST 417 722 … … 421 726 VBOXSF_EP16_BEGIN FS_CANCELLOCKREQUESTL, 'FS_CANCELLOCKREQUESTL' 422 727 VBOXSF_TO_32 FS_CANCELLOCKREQUESTL, 3*4 423 VBOXSF_FARPTR_2_FLAT 08h, 2*4 ; pLockRange424 VBOXSF_PSFFSD_2_FLAT 0ch, 1*4 ; psffsd425 VBOXSF_FARPTR_2_FLAT 10h, 0*4 ; psffsi426 call NAME(FS32_CANCELLOCKREQUESTL)728 VBOXSF_FARPTR_2_FLAT 08h, 2*4 ; pLockRange 729 VBOXSF_PSFFSD_2_FLAT 0ch, 1*4 ; psffsd 730 VBOXSF_FARPTR_2_FLAT 10h, 0*4 ; psffsi 731 call NAME(FS32_CANCELLOCKREQUESTL) 427 732 VBOXSF_TO_16 FS_CANCELLOCKREQUESTL 428 retf 0ch733 retf 0ch 429 734 VBOXSF_EP16_END FS_CANCELLOCKREQUESTL 430 735 … … 434 739 VBOXSF_EP16_BEGIN FS_CHDIR, 'FS_CHDIR' 435 740 VBOXSF_TO_32 FS_CHDIR, 5*4 436 movzx ecx, word [ebp + 08h] ; iCurDirEnd437 mov [esp + 4*4], ecx438 VBOXSF_FARPTR_2_FLAT 0ah, 3*4 ; pszDir439 VBOXSF_FARPTR_2_FLAT 0eh, 2*4 ; pcdfsd (use slow thunk here, see flag)440 VBOXSF_FARPTR_2_FLAT 12h, 1*4 ; pcdfsi441 movzx eax, word [ebp + 16h] ; flag442 mov [esp], eax443 call NAME(FS32_CHDIR)741 movsx ecx, word [ebp + 08h] ; iCurDirEnd 742 mov [esp + 4*4], ecx 743 VBOXSF_FARPTR_2_FLAT 0ah, 3*4 ; pszDir 744 VBOXSF_FARPTR_2_FLAT 0eh, 2*4 ; pcdfsd (use slow thunk here, see flag) 745 VBOXSF_FARPTR_2_FLAT 12h, 1*4 ; pcdfsi 746 movzx eax, word [ebp + 16h] ; flag 747 mov [esp], eax 748 call NAME(FS32_CHDIR) 444 749 VBOXSF_TO_16 FS_CHDIR 445 retf 10h750 retf 10h 446 751 VBOXSF_EP16_END FS_CHDIR 447 752 … … 450 755 VBOXSF_EP16_BEGIN FS_CHGFILEPTR, 'FS_CHGFILEPTR' 451 756 VBOXSF_TO_32 FS_CHGFILEPTR, 6*4 452 movzx ecx, word [ebp + 08h] ; IOflag453 mov [esp + 5*4], ecx454 movzx edx, word [ebp + 0ah] ; usMethod455 mov [esp + 4*4], edx456 mov eax, [ebp + 0ch] ; off457 mov [esp + 2*4], eax458 rol eax, 1 ; high dword - is there a better way than this?459 and eax, 1460 mov edx, 0ffffffffh461 mul edx462 mov [esp + 3*4], eax463 VBOXSF_PSFFSD_2_FLAT 10h, 1*4 ; psffsd464 VBOXSF_FARPTR_2_FLAT 14h, 0*4 ; psffsi465 call FS32_CHGFILEPTRL757 movzx ecx, word [ebp + 08h] ; IOflag 758 mov [esp + 5*4], ecx 759 movzx edx, word [ebp + 0ah] ; usMethod 760 mov [esp + 4*4], edx 761 mov eax, [ebp + 0ch] ; off 762 mov [esp + 2*4], eax 763 rol eax, 1 ; high dword - is there a better way than this? 764 and eax, 1 765 mov edx, 0ffffffffh 766 mul edx 767 mov [esp + 3*4], eax 768 VBOXSF_PSFFSD_2_FLAT 10h, 1*4 ; psffsd 769 VBOXSF_FARPTR_2_FLAT 14h, 0*4 ; psffsi 770 call FS32_CHGFILEPTRL 466 771 VBOXSF_TO_16 FS_CHGFILEPTR 467 retf 10h772 retf 10h 468 773 VBOXSF_EP16_END FS_CHGFILEPTR 469 774 … … 474 779 VBOXSF_EP16_BEGIN FS_CLOSE, 'FS_CLOSE' 475 780 VBOXSF_TO_32 FS_CLOSE, 4*4 476 VBOXSF_PSFFSD_2_FLAT 08h, 3*4 ; psffsd477 VBOXSF_FARPTR_2_FLAT 0ch, 2*4 ; psffsi478 movzx ecx, word [ebp + 10h] ; IOflag479 mov [esp + 1*4], ecx480 movzx edx, word [ebp + 12h] ; type481 mov [esp], edx482 call NAME(FS32_CLOSE)781 VBOXSF_PSFFSD_2_FLAT 08h, 3*4 ; psffsd 782 VBOXSF_FARPTR_2_FLAT 0ch, 2*4 ; psffsi 783 movzx ecx, word [ebp + 10h] ; IOflag 784 mov [esp + 1*4], ecx 785 movzx edx, word [ebp + 12h] ; type 786 mov [esp], edx 787 call NAME(FS32_CLOSE) 483 788 VBOXSF_TO_16 FS_CLOSE 484 retf 0ch789 retf 0ch 485 790 VBOXSF_EP16_END FS_CLOSE 486 791 … … 491 796 VBOXSF_EP16_BEGIN FS_COMMIT, 'FS_COMMIT' 492 797 VBOXSF_TO_32 FS_COMMIT, 4*4 493 VBOXSF_PSFFSD_2_FLAT 08h, 3*4 ; psffsd494 VBOXSF_FARPTR_2_FLAT 0ch, 2*4 ; psffsi495 movzx ecx, word [ebp + 10h] ; IOflag496 mov [esp + 1*4], ecx497 movzx edx, word [ebp + 12h] ; type498 mov [esp], edx499 call NAME(FS32_COMMIT)798 VBOXSF_PSFFSD_2_FLAT 08h, 3*4 ; psffsd 799 VBOXSF_FARPTR_2_FLAT 0ch, 2*4 ; psffsi 800 movzx ecx, word [ebp + 10h] ; IOflag 801 mov [esp + 1*4], ecx 802 movzx edx, word [ebp + 12h] ; type 803 mov [esp], edx 804 call NAME(FS32_COMMIT) 500 805 VBOXSF_TO_16 FS_COMMIT 501 retf 0ch806 retf 0ch 502 807 VBOXSF_EP16_END FS_COMMIT 503 808 … … 507 812 VBOXSF_EP16_BEGIN FS_COPY, 'FS_COPY' 508 813 VBOXSF_TO_32 FS_COPY, 8*4 509 movzx ecx, word [ebp + 08h] ; flag510 mov [esp + 7*4], ecx511 movzx edx, word [ebp + 0ah] ; iDstCurDirEnd512 mov [esp + 6*4], edx513 VBOXSF_FARPTR_2_FLAT 0ch, 5*4 ; pszDst514 movzx eax, word [ebp + 10h] ; iSrcCurDirEnd515 mov [esp + 4*4], eax516 VBOXSF_FARPTR_2_FLAT 12h, 3*4 ; pszSrc517 VBOXSF_PCDFSD_2_FLAT 16h, 2*4 ; psffsd518 VBOXSF_FARPTR_2_FLAT 1ah, 1*4 ; psffsi519 movzx ecx, word [ebp + 1eh] ; flag520 mov [esp], ecx521 call NAME(FS32_COPY)814 movzx ecx, word [ebp + 08h] ; flag 815 mov [esp + 7*4], ecx 816 movsx edx, word [ebp + 0ah] ; iDstCurDirEnd 817 mov [esp + 6*4], edx 818 VBOXSF_FARPTR_2_FLAT 0ch, 5*4 ; pszDst 819 movsx eax, word [ebp + 10h] ; iSrcCurDirEnd 820 mov [esp + 4*4], eax 821 VBOXSF_FARPTR_2_FLAT 12h, 3*4 ; pszSrc 822 VBOXSF_PCDFSD_2_FLAT 16h, 2*4 ; psffsd 823 VBOXSF_FARPTR_2_FLAT 1ah, 1*4 ; psffsi 824 movzx ecx, word [ebp + 1eh] ; flag 825 mov [esp], ecx 826 call NAME(FS32_COPY) 522 827 VBOXSF_TO_16 FS_COPY 523 retf 18h828 retf 18h 524 829 VBOXSF_EP16_END FS_COPY 525 830 … … 529 834 VBOXSF_EP16_BEGIN FS_DELETE, 'FS_DELETE' 530 835 VBOXSF_TO_32 FS_DELETE, 4*4 531 movzx ecx, word [ebp + 08h] ; iCurDirEnd532 mov [esp + 3*4], ecx533 VBOXSF_FARPTR_2_FLAT 0ah, 2*4 ; pszFile534 VBOXSF_PCDFSD_2_FLAT 0eh, 1*4 ; pcdfsd535 VBOXSF_FARPTR_2_FLAT 12h, 0*4 ; pcdfsi536 call NAME(FS32_DELETE)836 movsx ecx, word [ebp + 08h] ; iCurDirEnd 837 mov [esp + 3*4], ecx 838 VBOXSF_FARPTR_2_FLAT 0ah, 2*4 ; pszFile 839 VBOXSF_PCDFSD_2_FLAT 0eh, 1*4 ; pcdfsd 840 VBOXSF_FARPTR_2_FLAT 12h, 0*4 ; pcdfsi 841 call NAME(FS32_DELETE) 537 842 VBOXSF_TO_16 FS_DELETE 538 retf 0eh843 retf 0eh 539 844 VBOXSF_EP16_END FS_DELETE 540 845 … … 544 849 VBOXSF_EP16_BEGIN FS_DOPAGEIO, 'FS_DOPAGEIO' 545 850 VBOXSF_TO_32 FS_DOPAGEIO, 3*4 546 VBOXSF_FARPTR_2_FLAT 08h, 2*4 ; pList547 VBOXSF_PSFFSD_2_FLAT 0ch, 1*4 ; psffsd548 VBOXSF_FARPTR_2_FLAT 10h, 0*4 ; psffsi549 call NAME(FS32_DOPAGEIO)851 VBOXSF_FARPTR_2_FLAT 08h, 2*4 ; pList 852 VBOXSF_PSFFSD_2_FLAT 0ch, 1*4 ; psffsd 853 VBOXSF_FARPTR_2_FLAT 10h, 0*4 ; psffsi 854 call NAME(FS32_DOPAGEIO) 550 855 VBOXSF_TO_16 FS_DOPAGEIO 551 retf 0ch856 retf 0ch 552 857 VBOXSF_EP16_END FS_DOPAGEIO 553 858 … … 555 860 ; @cproto void FS_EXIT(USHORT uid, USHORT pid, USHORT pdb) 556 861 VBOXSF_EP16_BEGIN FS_EXIT, 'FS_EXIT' 557 ;558 ; Initialized ring-0 yet? (this is a likely first entry point)559 ;560 push ds561 mov ax, DATA16562 mov ds, ax563 test byte [NAME(g_fDoneRing0)], 1564 jnz .DoneRing0565 call NAME(VBoxSFR0Init16Bit)862 ; 863 ; Initialized ring-0 yet? (this is a likely first entry point) 864 ; 865 push ds 866 mov ax, DATA16 867 mov ds, ax 868 test byte [NAME(g_fDoneRing0)], 1 869 jnz .DoneRing0 870 call NAME(VBoxSFR0Init16Bit) 566 871 .DoneRing0: 567 pop ds872 pop ds 568 873 569 874 VBOXSF_TO_32 FS_EXIT, 3*4 570 movzx ecx, word [ebp + 08h] ; pdb571 mov [esp + 2*4], ecx572 movzx edx, word [ebp + 0ah] ; pib573 mov [esp + 1*4], edx574 movzx eax, word [ebp + 0ch] ; uid575 mov [esp], eax576 call NAME(FS32_EXIT)875 movzx ecx, word [ebp + 08h] ; pdb 876 mov [esp + 2*4], ecx 877 movzx edx, word [ebp + 0ah] ; pib 878 mov [esp + 1*4], edx 879 movzx eax, word [ebp + 0ch] ; uid 880 mov [esp], eax 881 call NAME(FS32_EXIT) 577 882 VBOXSF_TO_16 FS_EXIT 578 retf 6h883 retf 6h 579 884 VBOXSF_EP16_END FS_EXIT 580 885 … … 585 890 VBOXSF_EP16_BEGIN FS_FILEATTRIBUTE, 'FS_FILEATTRIBUTE' 586 891 VBOXSF_TO_32 FS_FILEATTRIBUTE, 6*4 587 VBOXSF_FARPTR_2_FLAT 08h, 5*4 ; pAttr588 movzx ecx, word [ebp + 0ch] ; iCurDirEnd589 mov [esp + 4*4], ecx590 VBOXSF_FARPTR_2_FLAT 0eh, 3*4 ; pszName591 VBOXSF_PCDFSD_2_FLAT 12h, 2*4 ; pcdfsd592 VBOXSF_FARPTR_2_FLAT 16h, 1*4 ; pcdfsi593 movzx edx, word [ebp + 1ah] ; flag594 mov [esp], edx595 call NAME(FS32_FILEATTRIBUTE)892 VBOXSF_FARPTR_2_FLAT 08h, 5*4 ; pAttr 893 movsx ecx, word [ebp + 0ch] ; iCurDirEnd - caller may pass 0xffff, so sign extend. 894 mov [esp + 4*4], ecx 895 VBOXSF_FARPTR_2_FLAT 0eh, 3*4 ; pszName 896 VBOXSF_PCDFSD_2_FLAT 12h, 2*4 ; pcdfsd 897 VBOXSF_FARPTR_2_FLAT 16h, 1*4 ; pcdfsi 898 movzx edx, word [ebp + 1ah] ; flag 899 mov [esp], edx 900 call NAME(FS32_FILEATTRIBUTE) 596 901 VBOXSF_TO_16 FS_FILEATTRIBUTE 597 retf 14h902 retf 14h 598 903 VBOXSF_EP16_END FS_FILEATTRIBUTE 599 904 … … 604 909 VBOXSF_EP16_BEGIN FS_FILEINFO, 'FS_FILEINFO' 605 910 VBOXSF_TO_32 FS_FILEINFO, 7*4 606 movzx ecx, word [ebp + 08h] ; IOflag607 mov [esp + 6*4], ecx608 movzx edx, word [ebp + 0ah] ; cbData609 mov [esp + 5*4], edx610 VBOXSF_FARPTR_2_FLAT 0ch, 4*4 ; pData611 movzx eax, word [ebp + 10h] ; level612 mov [esp + 3*4], eax613 VBOXSF_PSFFSD_2_FLAT 12h, 2*4 ; psffsd614 VBOXSF_FARPTR_2_FLAT 16h, 1*4 ; psffsi615 movzx ecx, word [ebp + 1ah] ; flag616 mov [esp], ecx617 call NAME(FS32_FILEINFO)911 movzx ecx, word [ebp + 08h] ; IOflag 912 mov [esp + 6*4], ecx 913 movzx edx, word [ebp + 0ah] ; cbData 914 mov [esp + 5*4], edx 915 VBOXSF_FARPTR_2_FLAT 0ch, 4*4 ; pData 916 movzx eax, word [ebp + 10h] ; level 917 mov [esp + 3*4], eax 918 VBOXSF_PSFFSD_2_FLAT 12h, 2*4 ; psffsd 919 VBOXSF_FARPTR_2_FLAT 16h, 1*4 ; psffsi 920 movzx ecx, word [ebp + 1ah] ; flag 921 mov [esp], ecx 922 call NAME(FS32_FILEINFO) 618 923 VBOXSF_TO_16 FS_FILEINFO 619 retf 14h924 retf 14h 620 925 VBOXSF_EP16_END FS_FILEINFO 621 926 … … 626 931 VBOXSF_EP16_BEGIN FS_FILEIO, 'FS_FILEIO' 627 932 VBOXSF_TO_32 FS_FILEIO, 6*4 628 movzx ecx, word [ebp + 08h] ; IOFlag629 mov [esp + 5*4], ecx630 VBOXSF_FARPTR_2_FLAT 0ah, 4*4 ; poError631 movzx edx, word [ebp + 0eh] ; cbCmdList632 mov [esp + 3*4], edx633 VBOXSF_FARPTR_2_FLAT 10h, 2*4 ; pCmdList634 VBOXSF_PSFFSD_2_FLAT 14h, 1*4 ; psffsd635 VBOXSF_FARPTR_2_FLAT 18h, 0*4 ; psffsi636 call NAME(FS32_FILEIO)933 movzx ecx, word [ebp + 08h] ; IOFlag 934 mov [esp + 5*4], ecx 935 VBOXSF_FARPTR_2_FLAT 0ah, 4*4 ; poError 936 movzx edx, word [ebp + 0eh] ; cbCmdList 937 mov [esp + 3*4], edx 938 VBOXSF_FARPTR_2_FLAT 10h, 2*4 ; pCmdList 939 VBOXSF_PSFFSD_2_FLAT 14h, 1*4 ; psffsd 940 VBOXSF_FARPTR_2_FLAT 18h, 0*4 ; psffsi 941 call NAME(FS32_FILEIO) 637 942 VBOXSF_TO_16 FS_FILEIO 638 retf 14h943 retf 14h 639 944 VBOXSF_EP16_END FS_FILEIO 640 945 … … 645 950 VBOXSF_EP16_BEGIN FS_FILELOCKS, 'FS_FILELOCKS' 646 951 VBOXSF_TO_32 FS_FILELOCKS, 6*4 647 mov ecx, [ebp + 08h] ; flags648 mov [esp + 5*4], ecx649 mov edx, [ebp + 0ch] ; timeout650 mov [esp + 4*4], edx651 VBOXSF_FARPTR_2_FLAT 10h, 3*4 ; pLockRange652 VBOXSF_FARPTR_2_FLAT 14h, 2*4 ; pUnLockRange653 VBOXSF_PSFFSD_2_FLAT 18h, 1*4 ; psffsd654 VBOXSF_FARPTR_2_FLAT 1ch, 0*4 ; psffsi655 call NAME(FS32_FILELOCKS)952 mov ecx, [ebp + 08h] ; flags 953 mov [esp + 5*4], ecx 954 mov edx, [ebp + 0ch] ; timeout 955 mov [esp + 4*4], edx 956 VBOXSF_FARPTR_2_FLAT 10h, 3*4 ; pLockRange 957 VBOXSF_FARPTR_2_FLAT 14h, 2*4 ; pUnLockRange 958 VBOXSF_PSFFSD_2_FLAT 18h, 1*4 ; psffsd 959 VBOXSF_FARPTR_2_FLAT 1ch, 0*4 ; psffsi 960 call NAME(FS32_FILELOCKS) 656 961 VBOXSF_TO_16 FS_FILELOCKS 657 retf 18h962 retf 18h 658 963 VBOXSF_EP16_END FS_FILELOCKS 659 964 … … 664 969 VBOXSF_EP16_BEGIN FS_FILELOCKSL, 'FS_FILELOCKSL' 665 970 VBOXSF_TO_32 FS_FILELOCKSL, 6*4 666 mov ecx, [ebp + 08h] ; flags667 mov [esp + 5*4], ecx668 mov edx, [ebp + 0ch] ; timeout669 mov [esp + 4*4], edx670 VBOXSF_FARPTR_2_FLAT 10h, 3*4 ; pLockRange671 VBOXSF_FARPTR_2_FLAT 14h, 2*4 ; pUnLockRange672 VBOXSF_PSFFSD_2_FLAT 18h, 1*4 ; psffsd673 VBOXSF_FARPTR_2_FLAT 1ch, 0*4 ; psffsi674 call NAME(FS32_FILELOCKS)971 mov ecx, [ebp + 08h] ; flags 972 mov [esp + 5*4], ecx 973 mov edx, [ebp + 0ch] ; timeout 974 mov [esp + 4*4], edx 975 VBOXSF_FARPTR_2_FLAT 10h, 3*4 ; pLockRange 976 VBOXSF_FARPTR_2_FLAT 14h, 2*4 ; pUnLockRange 977 VBOXSF_PSFFSD_2_FLAT 18h, 1*4 ; psffsd 978 VBOXSF_FARPTR_2_FLAT 1ch, 0*4 ; psffsi 979 call NAME(FS32_FILELOCKS) 675 980 VBOXSF_TO_16 FS_FILELOCKSL 676 retf 18h981 retf 18h 677 982 VBOXSF_EP16_END FS_FILELOCKSL 678 983 … … 683 988 VBOXSF_EP16_BEGIN FS_FINDCLOSE, 'FS_FINDCLOSE' 684 989 VBOXSF_TO_32 FS_FINDCLOSE, 2*4 685 VBOXSF_PFSFSD_2_FLAT 08h, 1*4 ; pfsfsd686 VBOXSF_FARPTR_2_FLAT 0ch, 0*4 ; pfsfsi687 call NAME(FS32_FINDCLOSE)990 VBOXSF_PFSFSD_2_FLAT 08h, 1*4 ; pfsfsd 991 VBOXSF_FARPTR_2_FLAT 0ch, 0*4 ; pfsfsi 992 call NAME(FS32_FINDCLOSE) 688 993 VBOXSF_TO_16 FS_FINDCLOSE 689 retf 8h994 retf 8h 690 995 VBOXSF_EP16_END FS_FINDCLOSE 691 996 … … 698 1003 VBOXSF_EP16_BEGIN FS_FINDFIRST, 'FS_FINDFIRST' 699 1004 VBOXSF_TO_32 FS_FINDFIRST, 12*4 700 movzx ecx, word [ebp + 08h] ; flags701 mov [esp + 11*4], ecx702 movzx edx, word [ebp + 0ah] ; level703 mov [esp + 10*4], edx704 VBOXSF_FARPTR_2_FLAT 0ch, 9*4 ; pcMatch705 movzx eax, word [ebp + 10h] ; cbData706 mov [esp + 8*4], eax707 VBOXSF_FARPTR_2_FLAT 12h, 7*4 ; pbData708 VBOXSF_FARPTR_2_FLAT 16h, 6*4 ; pfsfsd709 VBOXSF_FARPTR_2_FLAT 1ah, 5*4 ; pfsfsi710 movzx ecx, word [ebp + 1eh] ; attr711 mov [esp + 4*4], ecx712 movzx edx, word [ebp + 20h] ; iCurDirEnd713 mov [esp + 3*4], edx714 VBOXSF_FARPTR_2_FLAT 22h, 2*4 ; pszName715 VBOXSF_PCDFSD_2_FLAT 26h, 1*4 ; pcdfsd716 VBOXSF_FARPTR_2_FLAT 2ah, 0*4 ; pcdfsi717 call NAME(FS32_FINDFIRST)1005 movzx ecx, word [ebp + 08h] ; flags 1006 mov [esp + 11*4], ecx 1007 movzx edx, word [ebp + 0ah] ; level 1008 mov [esp + 10*4], edx 1009 VBOXSF_FARPTR_2_FLAT 0ch, 9*4 ; pcMatch 1010 movzx eax, word [ebp + 10h] ; cbData 1011 mov [esp + 8*4], eax 1012 VBOXSF_FARPTR_2_FLAT 12h, 7*4 ; pbData 1013 VBOXSF_FARPTR_2_FLAT 16h, 6*4 ; pfsfsd 1014 VBOXSF_FARPTR_2_FLAT 1ah, 5*4 ; pfsfsi 1015 movzx ecx, word [ebp + 1eh] ; attr 1016 mov [esp + 4*4], ecx 1017 movsx edx, word [ebp + 20h] ; iCurDirEnd 1018 mov [esp + 3*4], edx 1019 VBOXSF_FARPTR_2_FLAT 22h, 2*4 ; pszName 1020 VBOXSF_PCDFSD_2_FLAT 26h, 1*4 ; pcdfsd 1021 VBOXSF_FARPTR_2_FLAT 2ah, 0*4 ; pcdfsi 1022 call NAME(FS32_FINDFIRST) 718 1023 VBOXSF_TO_16 FS_FINDFIRST 719 retf 26h1024 retf 26h 720 1025 VBOXSF_EP16_END FS_FINDFIRST 721 1026 … … 727 1032 VBOXSF_EP16_BEGIN FS_FINDFROMNAME, 'FS_FINDFROMNAME' 728 1033 VBOXSF_TO_32 FS_FINDFROMNAME, 9*4 729 movzx ecx, word [ebp + 08h] ; flags730 mov [esp + 8*4], ecx731 VBOXSF_FARPTR_2_FLAT 0ah, 7*4 ; pszName732 mov edx, [ebp + 0eh] ; position733 mov [esp + 6*4], edx734 movzx eax, word [ebp + 12h] ; level735 mov [esp + 5*4], eax736 VBOXSF_FARPTR_2_FLAT 14h, 4*4 ; pcMatch737 movzx eax, word [ebp + 18h] ; cbData738 mov [esp + 3*4], eax739 VBOXSF_FARPTR_2_FLAT 1ah, 2*4 ; pbData740 VBOXSF_PFSFSD_2_FLAT 1eh, 1*4 ; pfsfsd741 VBOXSF_FARPTR_2_FLAT 22h, 0*4 ; pfsfsi742 call NAME(FS32_FINDFROMNAME)1034 movzx ecx, word [ebp + 08h] ; flags 1035 mov [esp + 8*4], ecx 1036 VBOXSF_FARPTR_2_FLAT 0ah, 7*4 ; pszName 1037 mov edx, [ebp + 0eh] ; position 1038 mov [esp + 6*4], edx 1039 movzx eax, word [ebp + 12h] ; level 1040 mov [esp + 5*4], eax 1041 VBOXSF_FARPTR_2_FLAT 14h, 4*4 ; pcMatch 1042 movzx eax, word [ebp + 18h] ; cbData 1043 mov [esp + 3*4], eax 1044 VBOXSF_FARPTR_2_FLAT 1ah, 2*4 ; pbData 1045 VBOXSF_PFSFSD_2_FLAT 1eh, 1*4 ; pfsfsd 1046 VBOXSF_FARPTR_2_FLAT 22h, 0*4 ; pfsfsi 1047 call NAME(FS32_FINDFROMNAME) 743 1048 VBOXSF_TO_16 FS_FINDFROMNAME 744 retf 1eh1049 retf 1eh 745 1050 VBOXSF_EP16_END FS_FINDFROMNAME 746 1051 … … 752 1057 VBOXSF_EP16_BEGIN FS_FINDNEXT, 'FS_FINDNEXT' 753 1058 VBOXSF_TO_32 FS_FINDNEXT, 7*4 754 movzx ecx, word [ebp + 08h] ; flags755 mov [esp + 6*4], ecx756 movzx eax, word [ebp + 0ah] ; level757 mov [esp + 5*4], eax758 VBOXSF_FARPTR_2_FLAT 0ch, 4*4 ; pcMatch759 movzx eax, word [ebp + 10h] ; cbData760 mov [esp + 3*4], eax761 VBOXSF_FARPTR_2_FLAT 12h, 2*4 ; pbData762 VBOXSF_PFSFSD_2_FLAT 16h, 1*4 ; pfsfsd763 VBOXSF_FARPTR_2_FLAT 1ah, 0*4 ; pfsfsi764 call NAME(FS32_FINDNEXT)1059 movzx ecx, word [ebp + 08h] ; flags 1060 mov [esp + 6*4], ecx 1061 movzx eax, word [ebp + 0ah] ; level 1062 mov [esp + 5*4], eax 1063 VBOXSF_FARPTR_2_FLAT 0ch, 4*4 ; pcMatch 1064 movzx eax, word [ebp + 10h] ; cbData 1065 mov [esp + 3*4], eax 1066 VBOXSF_FARPTR_2_FLAT 12h, 2*4 ; pbData 1067 VBOXSF_PFSFSD_2_FLAT 16h, 1*4 ; pfsfsd 1068 VBOXSF_FARPTR_2_FLAT 1ah, 0*4 ; pfsfsi 1069 call NAME(FS32_FINDNEXT) 765 1070 VBOXSF_TO_16 FS_FINDNEXT 766 retf 16h1071 retf 16h 767 1072 VBOXSF_EP16_END FS_FINDNEXT 768 1073 … … 773 1078 VBOXSF_EP16_BEGIN FS_FINDNOTIFYCLOSE, 'FS_FINDNOTIFYCLOSE' 774 1079 VBOXSF_TO_32 FS_FINDNOTIFYCLOSE, 1*4 775 movzx ecx, word [ebp + 08h] ; handle776 mov [esp], ecx777 call NAME(FS32_FINDNOTIFYCLOSE)1080 movzx ecx, word [ebp + 08h] ; handle 1081 mov [esp], ecx 1082 call NAME(FS32_FINDNOTIFYCLOSE) 778 1083 VBOXSF_TO_16 FS_FINDNOTIFYCLOSE 779 retf 2h1084 retf 2h 780 1085 VBOXSF_EP16_END FS_FINDNOTIFYCLOSE 781 1086 … … 788 1093 VBOXSF_EP16_BEGIN FS_FINDNOTIFYFIRST, 'FS_FINDNOTIFYFIRST' 789 1094 VBOXSF_TO_32 FS_FINDNOTIFYFIRST, 11*4 790 movzx ecx, word [ebp + 08h] ; flags791 mov [esp + 10*4], ecx792 movzx edx, word [ebp + 0ah] ; level793 mov [esp + 9*4], edx794 VBOXSF_FARPTR_2_FLAT 0ch, 8*4 ; pcMatch795 movzx eax, word [ebp + 10h] ; cbData796 mov [esp + 7*4], eax797 VBOXSF_FARPTR_2_FLAT 12h, 6*4 ; pbData798 VBOXSF_FARPTR_2_FLAT 16h, 5*4 ; pHandle799 movzx ecx, word [ebp + 1ah] ; attr800 mov [esp + 4*4], ecx801 movzx edx, word [ebp + 1ch] ; iCurDirEnd802 mov [esp + 3*4], edx803 VBOXSF_FARPTR_2_FLAT 1eh, 2*4 ; pszName804 VBOXSF_PCDFSD_2_FLAT 22h, 1*4 ; pcdfsd805 VBOXSF_FARPTR_2_FLAT 26h, 0*4 ; pcdfsi806 call NAME(FS32_FINDNOTIFYFIRST)1095 movzx ecx, word [ebp + 08h] ; flags 1096 mov [esp + 10*4], ecx 1097 movzx edx, word [ebp + 0ah] ; level 1098 mov [esp + 9*4], edx 1099 VBOXSF_FARPTR_2_FLAT 0ch, 8*4 ; pcMatch 1100 movzx eax, word [ebp + 10h] ; cbData 1101 mov [esp + 7*4], eax 1102 VBOXSF_FARPTR_2_FLAT 12h, 6*4 ; pbData 1103 VBOXSF_FARPTR_2_FLAT 16h, 5*4 ; pHandle 1104 movzx ecx, word [ebp + 1ah] ; attr 1105 mov [esp + 4*4], ecx 1106 movsx edx, word [ebp + 1ch] ; iCurDirEnd 1107 mov [esp + 3*4], edx 1108 VBOXSF_FARPTR_2_FLAT 1eh, 2*4 ; pszName 1109 VBOXSF_PCDFSD_2_FLAT 22h, 1*4 ; pcdfsd 1110 VBOXSF_FARPTR_2_FLAT 26h, 0*4 ; pcdfsi 1111 call NAME(FS32_FINDNOTIFYFIRST) 807 1112 VBOXSF_TO_16 FS_FINDNOTIFYFIRST 808 retf 22h1113 retf 22h 809 1114 VBOXSF_EP16_END FS_FINDNOTIFYFIRST 810 1115 … … 816 1121 VBOXSF_EP16_BEGIN FS_FINDNOTIFYNEXT, 'FS_FINDNOTIFYNEXT' 817 1122 VBOXSF_TO_32 FS_FINDNOTIFYNEXT, 6*4 818 mov ecx, [ebp + 08h] ; timeout819 mov [esp + 5*4], ecx820 movzx edx, word [ebp + 0ch] ; level821 mov [esp + 4*4], edx822 VBOXSF_FARPTR_2_FLAT 0eh, 3*4 ; pcMatch823 movzx eax, word [ebp + 12h] ; cbData824 mov [esp + 2*4], eax825 VBOXSF_FARPTR_2_FLAT 14h, 1*4 ; pbData826 movzx ecx, word [ebp + 18h] ; handle827 mov [esp], ecx828 call NAME(FS32_FINDNOTIFYNEXT)1123 mov ecx, [ebp + 08h] ; timeout 1124 mov [esp + 5*4], ecx 1125 movzx edx, word [ebp + 0ch] ; level 1126 mov [esp + 4*4], edx 1127 VBOXSF_FARPTR_2_FLAT 0eh, 3*4 ; pcMatch 1128 movzx eax, word [ebp + 12h] ; cbData 1129 mov [esp + 2*4], eax 1130 VBOXSF_FARPTR_2_FLAT 14h, 1*4 ; pbData 1131 movzx ecx, word [ebp + 18h] ; handle 1132 mov [esp], ecx 1133 call NAME(FS32_FINDNOTIFYNEXT) 829 1134 VBOXSF_TO_16 FS_FINDNOTIFYNEXT 830 retf 12h1135 retf 12h 831 1136 VBOXSF_EP16_END FS_FINDNOTIFYNEXT 832 1137 … … 835 1140 VBOXSF_EP16_BEGIN FS_FLUSHBUF, 'FS_FLUSHBUF' 836 1141 VBOXSF_TO_32 FS_FLUSHBUF, 2*4 837 movzx edx, word [ebp + 08h] ; flag838 mov [esp + 1*4], edx839 movzx eax, word [ebp + 0ch] ; hVPB840 mov [esp + 0*4], eax841 call NAME(FS32_FLUSHBUF)1142 movzx edx, word [ebp + 08h] ; flag 1143 mov [esp + 1*4], edx 1144 movzx eax, word [ebp + 0ch] ; hVPB 1145 mov [esp + 0*4], eax 1146 call NAME(FS32_FLUSHBUF) 842 1147 VBOXSF_TO_16 FS_FLUSHBUF 843 retf 4h1148 retf 4h 844 1149 VBOXSF_EP16_END FS_FLUSHBUF 845 1150 … … 849 1154 ; PVOID pData, USHORT lenData, PUSHORT plenDataIO); 850 1155 VBOXSF_EP16_BEGIN FS_FSCTL, 'FS_FSCTL' 851 ;852 ; Initialized ring-0 yet? (this is a likely first entry point)853 ;854 push ds855 mov ax, DATA16856 mov ds, ax857 test byte [NAME(g_fDoneRing0)], 1858 jnz .DoneRing0859 call NAME(VBoxSFR0Init16Bit)1156 ; 1157 ; Initialized ring-0 yet? (this is a likely first entry point) 1158 ; 1159 push ds 1160 mov ax, DATA16 1161 mov ds, ax 1162 test byte [NAME(g_fDoneRing0)], 1 1163 jnz .DoneRing0 1164 call NAME(VBoxSFR0Init16Bit) 860 1165 .DoneRing0: 861 pop ds1166 pop ds 862 1167 863 1168 VBOXSF_TO_32 FS_FSCTL, 9*4 864 VBOXSF_FARPTR_2_FLAT 08h, 8*4 ; plenDataIO865 movzx ecx, word [ebp + 0ch] ; lenData866 mov [esp + 7*4], ecx867 VBOXSF_FARPTR_2_FLAT 0eh, 6*4 ; pData868 VBOXSF_FARPTR_2_FLAT 12h, 5*4 ; plenDataIO869 movzx ecx, word [ebp + 16h] ; lenData870 mov [esp + 4*4], ecx871 VBOXSF_FARPTR_2_FLAT 18h, 3*4 ; pData872 movzx edx, word [ebp + 1ch] ; func873 mov [esp + 2*4], edx874 movzx eax, word [ebp + 1eh] ; iArgType875 mov [esp + 1*4], eax876 VBOXSF_FARPTR_2_FLAT 20h, 0*4 ; pArgdat877 call NAME(FS32_FSCTL)1169 VBOXSF_FARPTR_2_FLAT 08h, 8*4 ; plenDataIO 1170 movzx ecx, word [ebp + 0ch] ; lenData 1171 mov [esp + 7*4], ecx 1172 VBOXSF_FARPTR_2_FLAT 0eh, 6*4 ; pData 1173 VBOXSF_FARPTR_2_FLAT 12h, 5*4 ; plenDataIO 1174 movzx ecx, word [ebp + 16h] ; lenData 1175 mov [esp + 4*4], ecx 1176 VBOXSF_FARPTR_2_FLAT 18h, 3*4 ; pData 1177 movzx edx, word [ebp + 1ch] ; func 1178 mov [esp + 2*4], edx 1179 movzx eax, word [ebp + 1eh] ; iArgType 1180 mov [esp + 1*4], eax 1181 VBOXSF_FARPTR_2_FLAT 20h, 0*4 ; pArgdat 1182 call NAME(FS32_FSCTL) 878 1183 VBOXSF_TO_16 FS_FSCTL 879 retf 1ch1184 retf 1ch 880 1185 VBOXSF_EP16_END FS_FSCTL 881 1186 … … 884 1189 VBOXSF_EP16_BEGIN FS_FSINFO, 'FS_FSINFO' 885 1190 VBOXSF_TO_32 FS_FSINFO, 5*4 886 movzx ecx, word [ebp + 08h] ; level887 mov [esp + 10h], ecx888 movzx edx, word [ebp + 0ah] ; cbData889 mov [esp + 0ch], edx890 VBOXSF_FARPTR_2_FLAT 0ch, 2*4 ; pbData891 movzx edx, word [ebp + 10h] ; hVPB892 mov [esp], edx893 movzx eax, word [ebp + 12h] ; flag894 mov [esp], eax895 call NAME(FS32_FSINFO)1191 movzx ecx, word [ebp + 08h] ; level 1192 mov [esp + 10h], ecx 1193 movzx edx, word [ebp + 0ah] ; cbData 1194 mov [esp + 0ch], edx 1195 VBOXSF_FARPTR_2_FLAT 0ch, 2*4 ; pbData 1196 movzx edx, word [ebp + 10h] ; hVPB 1197 mov [esp + 4], edx 1198 movzx eax, word [ebp + 12h] ; flag 1199 mov [esp], eax 1200 call NAME(FS32_FSINFO) 896 1201 VBOXSF_TO_16 FS_FSINFO 897 retf 14h1202 retf 14h 898 1203 VBOXSF_EP16_END FS_FSINFO 899 1204 … … 905 1210 VBOXSF_EP16_BEGIN FS_IOCTL, 'FS_IOCTL' 906 1211 VBOXSF_TO_32 FS_IOCTL, 10*4 907 VBOXSF_FARPTR_2_FLAT 08h, 9*4 ; plenDataIO908 movzx ecx, word [ebp + 0ch] ; lenData909 mov [esp + 8*4], ecx910 VBOXSF_FARPTR_2_FLAT 0eh, 7*4 ; pData911 VBOXSF_FARPTR_2_FLAT 12h, 6*4 ; plenDataIO912 movzx ecx, word [ebp + 16h] ; lenData913 mov [esp + 5*4], ecx914 VBOXSF_FARPTR_2_FLAT 18h, 4*4 ; pData915 movzx edx, word [ebp + 1ch] ; cat916 mov [esp + 3*4], edx917 movzx eax, word [ebp + 1eh] ; func918 mov [esp + 2*4], eax919 VBOXSF_PSFFSD_2_FLAT 20h, 1*4 ; psffsd920 VBOXSF_FARPTR_2_FLAT 24h, 0*4 ; pData921 call NAME(FS32_IOCTL)1212 VBOXSF_FARPTR_2_FLAT 08h, 9*4 ; plenDataIO 1213 movzx ecx, word [ebp + 0ch] ; lenData 1214 mov [esp + 8*4], ecx 1215 VBOXSF_FARPTR_2_FLAT 0eh, 7*4 ; pData 1216 VBOXSF_FARPTR_2_FLAT 12h, 6*4 ; plenDataIO 1217 movzx ecx, word [ebp + 16h] ; lenData 1218 mov [esp + 5*4], ecx 1219 VBOXSF_FARPTR_2_FLAT 18h, 4*4 ; pData 1220 movzx edx, word [ebp + 1ch] ; cat 1221 mov [esp + 3*4], edx 1222 movzx eax, word [ebp + 1eh] ; func 1223 mov [esp + 2*4], eax 1224 VBOXSF_PSFFSD_2_FLAT 20h, 1*4 ; psffsd 1225 VBOXSF_FARPTR_2_FLAT 24h, 0*4 ; pData 1226 call NAME(FS32_IOCTL) 922 1227 VBOXSF_TO_16 FS_IOCTL 923 retf 20h1228 retf 20h 924 1229 VBOXSF_EP16_END FS_IOCTL 925 1230 … … 930 1235 VBOXSF_EP16_BEGIN FS_MKDIR, 'FS_MKDIR' 931 1236 VBOXSF_TO_32 FS_MKDIR, 6*4 932 movzx ecx, word [ebp + 08h] ; flag933 mov [esp + 5*4], ecx934 VBOXSF_FARPTR_2_FLAT 0ah, 4*4 ; pEABuf935 movzx edx, word [ebp + 0eh] ; iCurDirEnd936 mov [esp + 3*4], edx937 VBOXSF_FARPTR_2_FLAT 10h, 2*4 ; pszName938 VBOXSF_PCDFSD_2_FLAT 14h, 1*4 ; pcdfsd939 VBOXSF_FARPTR_2_FLAT 18h, 0*4 ; pcdfsi940 call NAME(FS32_MKDIR)1237 movzx ecx, word [ebp + 08h] ; flag 1238 mov [esp + 5*4], ecx 1239 VBOXSF_FARPTR_2_FLAT 0ah, 4*4 ; pEABuf 1240 movsx edx, word [ebp + 0eh] ; iCurDirEnd 1241 mov [esp + 3*4], edx 1242 VBOXSF_FARPTR_2_FLAT 10h, 2*4 ; pszName 1243 VBOXSF_PCDFSD_2_FLAT 14h, 1*4 ; pcdfsd 1244 VBOXSF_FARPTR_2_FLAT 18h, 0*4 ; pcdfsi 1245 call NAME(FS32_MKDIR) 941 1246 VBOXSF_TO_16 FS_MKDIR 942 retf 14h1247 retf 14h 943 1248 VBOXSF_EP16_END FS_MKDIR 944 1249 … … 947 1252 ; @cproto int FS_MOUNT(USHORT flag, PVPFSI pvpfsi, PVBOXSFVP pvpfsd, USHORT hVPB, PCSZ pszBoot) 948 1253 VBOXSF_EP16_BEGIN FS_MOUNT, 'FS_MOUNT' 949 ;950 ; Initialized ring-0 yet? (this is a likely first entry point)951 ;952 push ds953 mov ax, DATA16954 mov ds, ax955 test byte [NAME(g_fDoneRing0)], 1956 jnz .DoneRing0957 call NAME(VBoxSFR0Init16Bit)1254 ; 1255 ; Initialized ring-0 yet? (this is a likely first entry point) 1256 ; 1257 push ds 1258 mov ax, DATA16 1259 mov ds, ax 1260 test byte [NAME(g_fDoneRing0)], 1 1261 jnz .DoneRing0 1262 call NAME(VBoxSFR0Init16Bit) 958 1263 .DoneRing0: 959 pop ds1264 pop ds 960 1265 961 1266 VBOXSF_TO_32 FS_MOUNT, 5*4 962 VBOXSF_FARPTR_2_FLAT 08h, 4*4 ; pszBoot963 movzx ecx, word [ebp + 0ch] ; hVPB964 mov [esp + 3*4], ecx965 VBOXSF_FARPTR_2_FLAT 0eh, 2*4 ; pvpfsd966 VBOXSF_FARPTR_2_FLAT 12h, 1*4 ; pvpfsi967 movzx ecx, word [ebp + 16h] ; flag968 mov [esp], ecx969 call NAME(FS32_MOUNT)1267 VBOXSF_FARPTR_2_FLAT 08h, 4*4 ; pszBoot 1268 movzx ecx, word [ebp + 0ch] ; hVPB 1269 mov [esp + 3*4], ecx 1270 VBOXSF_FARPTR_2_FLAT 0eh, 2*4 ; pvpfsd 1271 VBOXSF_FARPTR_2_FLAT 12h, 1*4 ; pvpfsi 1272 movzx ecx, word [ebp + 16h] ; flag 1273 mov [esp], ecx 1274 call NAME(FS32_MOUNT) 970 1275 VBOXSF_TO_16 FS_MOUNT 971 retf 10h1276 retf 10h 972 1277 VBOXSF_EP16_END FS_MOUNT 973 1278 … … 978 1283 VBOXSF_EP16_BEGIN FS_MOVE, 'FS_MOVE' 979 1284 VBOXSF_TO_32 FS_MOVE, 7*4 980 movzx ecx, word [ebp + 08h] ; type981 mov [esp + 6*4], ecx982 movzx edx, word [ebp + 0ah] ; iDstCurDirEnd983 mov [esp + 5*4], edx984 VBOXSF_FARPTR_2_FLAT 0ch, 4*4 ; pszDst985 movzx eax, word [ebp + 10h] ; iSrcCurDirEnd986 mov [esp + 3*4], eax987 VBOXSF_FARPTR_2_FLAT 12h, 2*4 ; pszSrc988 VBOXSF_PCDFSD_2_FLAT 16h, 1*4 ; psffsd989 VBOXSF_FARPTR_2_FLAT 1ah, 0*4 ; psffsi990 call NAME(FS32_MOVE)1285 movzx ecx, word [ebp + 08h] ; type 1286 mov [esp + 6*4], ecx 1287 movzx edx, word [ebp + 0ah] ; iDstCurDirEnd 1288 mov [esp + 5*4], edx 1289 VBOXSF_FARPTR_2_FLAT 0ch, 4*4 ; pszDst 1290 movzx eax, word [ebp + 10h] ; iSrcCurDirEnd 1291 mov [esp + 3*4], eax 1292 VBOXSF_FARPTR_2_FLAT 12h, 2*4 ; pszSrc 1293 VBOXSF_PCDFSD_2_FLAT 16h, 1*4 ; psffsd 1294 VBOXSF_FARPTR_2_FLAT 1ah, 0*4 ; psffsi 1295 call NAME(FS32_MOVE) 991 1296 VBOXSF_TO_16 FS_MOVE 992 retf 16h1297 retf 16h 993 1298 VBOXSF_EP16_END FS_MOVE 994 1299 … … 998 1303 VBOXSF_EP16_BEGIN FS_NEWSIZE, 'FS_NEWSIZE' 999 1304 VBOXSF_TO_32 FS_NEWSIZE, 5*4 ; thunking to longlong edition. 1000 movzx ecx, word [ebp + 08h] ; IOflag1001 mov [esp + 4*4], ecx1002 mov eax, [ebp + 0ah] ; cbFile (ULONG -> LONGLONG)1003 mov dword [esp + 3*4], 01004 mov [esp + 2*4], eax1005 VBOXSF_PSFFSD_2_FLAT 0eh, 1*4 ; psffsd1006 VBOXSF_FARPTR_2_FLAT 12h, 0*4 ; psffsi1007 call NAME(FS32_NEWSIZEL)1305 movzx ecx, word [ebp + 08h] ; IOflag 1306 mov [esp + 4*4], ecx 1307 mov eax, [ebp + 0ah] ; cbFile (ULONG -> LONGLONG) 1308 mov dword [esp + 3*4], 0 1309 mov [esp + 2*4], eax 1310 VBOXSF_PSFFSD_2_FLAT 0eh, 1*4 ; psffsd 1311 VBOXSF_FARPTR_2_FLAT 12h, 0*4 ; psffsi 1312 call NAME(FS32_NEWSIZEL) 1008 1313 VBOXSF_TO_16 FS_NEWSIZE 1009 retf 0eh1314 retf 0eh 1010 1315 VBOXSF_EP16_END FS_NEWSIZE 1011 1316 … … 1015 1320 VBOXSF_EP16_BEGIN FS_NEWSIZEL, 'FS_NEWSIZEL' 1016 1321 VBOXSF_TO_32 FS_NEWSIZEL, 5*4 1017 movzx ecx, word [ebp + 08h] ; IOflag1018 mov [esp + 4*4], ecx1019 mov eax, [ebp + 0ah] ; cbFile1020 mov edx, [ebp + 0eh]1021 mov [esp + 3*4], edx1022 mov [esp + 2*4], eax1023 VBOXSF_PSFFSD_2_FLAT 12h, 1*4 ; psffsd1024 VBOXSF_FARPTR_2_FLAT 16h, 0*4 ; psffsi1025 call NAME(FS32_NEWSIZEL)1322 movzx ecx, word [ebp + 08h] ; IOflag 1323 mov [esp + 4*4], ecx 1324 mov eax, [ebp + 0ah] ; cbFile 1325 mov edx, [ebp + 0eh] 1326 mov [esp + 3*4], edx 1327 mov [esp + 2*4], eax 1328 VBOXSF_PSFFSD_2_FLAT 12h, 1*4 ; psffsd 1329 VBOXSF_FARPTR_2_FLAT 16h, 0*4 ; psffsi 1330 call NAME(FS32_NEWSIZEL) 1026 1331 VBOXSF_TO_16 FS_NEWSIZEL 1027 retf 12h1332 retf 12h 1028 1333 VBOXSF_EP16_END FS_NEWSIZEL 1029 1334 … … 1034 1339 VBOXSF_EP16_BEGIN FS_NMPIPE, 'FS_NMPIPE' 1035 1340 VBOXSF_TO_32 FS_NMPIPE, 6*4 1036 VBOXSF_FARPTR_2_FLAT 08h, 5*4 ; pszName1037 VBOXSF_FARPTR_2_FLAT 0ch, 4*4 ; pData1038 VBOXSF_FARPTR_2_FLAT 10h, 3*4 ; pOpRec1039 movzx ecx, word [ebp + 14h] ; OpType1040 mov [esp + 2*4], ecx1041 VBOXSF_FARPTR_2_FLAT 16h, 1*4 ; psffsd (take care...)1042 VBOXSF_FARPTR_2_FLAT 1ah, 0*4 ; psffsi1043 call NAME(FS32_NMPIPE)1341 VBOXSF_FARPTR_2_FLAT 08h, 5*4 ; pszName 1342 VBOXSF_FARPTR_2_FLAT 0ch, 4*4 ; pData 1343 VBOXSF_FARPTR_2_FLAT 10h, 3*4 ; pOpRec 1344 movzx ecx, word [ebp + 14h] ; OpType 1345 mov [esp + 2*4], ecx 1346 VBOXSF_FARPTR_2_FLAT 16h, 1*4 ; psffsd (take care...) 1347 VBOXSF_FARPTR_2_FLAT 1ah, 0*4 ; psffsi 1348 call NAME(FS32_NMPIPE) 1044 1349 VBOXSF_TO_16 FS_NMPIPE 1045 retf 16h1350 retf 16h 1046 1351 VBOXSF_EP16_END FS_NMPIPE 1047 1352 … … 1053 1358 VBOXSF_EP16_BEGIN FS_OPENCREATE, 'FS_OPENCREATE' 1054 1359 VBOXSF_TO_32 FS_OPENCREATE, 12*4 1055 VBOXSF_FARPTR_2_FLAT 08h, 11*4 ; pfgenflag1056 VBOXSF_FARPTR_2_FLAT 0ch, 10*4 ; pcEABuf1057 movzx ecx, word [ebp + 10h] ; usAttr1058 mov [esp + 9*4], ecx1059 VBOXSF_FARPTR_2_FLAT 12h, 8*4 ; pusAction1060 movzx edx, word [ebp + 16h] ; usOpenFlag1061 mov [esp + 7*4], edx1062 mov eax, [ebp + 18h] ; ulOpenMode1063 mov [esp + 6*4], eax1064 VBOXSF_FARPTR_2_FLAT 1ch, 5*4 ; psffsd (new, no short cuts)1065 VBOXSF_FARPTR_2_FLAT 20h, 4*4 ; psffsi1066 movzx ecx, word [ebp + 24h] ; iCurDirEnd1067 mov [esp + 3*4], ecx1068 VBOXSF_FARPTR_2_FLAT 26h, 2*4 ; pszName1069 VBOXSF_PCDFSD_2_FLAT 2ah, 1*4 ; pcdfsd1070 VBOXSF_FARPTR_2_FLAT 2eh, 0*4 ; pcdfsi1071 call NAME(FS32_OPENCREATE)1360 VBOXSF_FARPTR_2_FLAT 08h, 11*4 ; pfgenflag 1361 VBOXSF_FARPTR_2_FLAT 0ch, 10*4 ; pcEABuf 1362 movzx ecx, word [ebp + 10h] ; usAttr 1363 mov [esp + 9*4], ecx 1364 VBOXSF_FARPTR_2_FLAT 12h, 8*4 ; pusAction 1365 movzx edx, word [ebp + 16h] ; usOpenFlag 1366 mov [esp + 7*4], edx 1367 mov eax, [ebp + 18h] ; ulOpenMode 1368 mov [esp + 6*4], eax 1369 VBOXSF_FARPTR_2_FLAT 1ch, 5*4 ; psffsd (new, no short cuts) 1370 VBOXSF_FARPTR_2_FLAT 20h, 4*4 ; psffsi 1371 movsx ecx, word [ebp + 24h] ; iCurDirEnd 1372 mov [esp + 3*4], ecx 1373 VBOXSF_FARPTR_2_FLAT 26h, 2*4 ; pszName 1374 VBOXSF_PCDFSD_2_FLAT 2ah, 1*4 ; pcdfsd 1375 VBOXSF_FARPTR_2_FLAT 2eh, 0*4 ; pcdfsi 1376 call NAME(FS32_OPENCREATE) 1072 1377 VBOXSF_TO_16 FS_OPENCREATE 1073 retf 421378 retf 42 1074 1379 VBOXSF_EP16_END FS_OPENCREATE 1075 1380 … … 1080 1385 VBOXSF_EP16_BEGIN FS_OPENPAGEFILE, 'FS_OPENPAGEFILE' 1081 1386 VBOXSF_TO_32 FS_OPENPAGEFILE, 9*4 1082 mov ecx, [ebp + 08h] ; Reserved1083 mov [esp + 8*4], ecx1084 movzx edx, word [ebp + 0ch] ; usAttr1085 mov [esp + 7*4], edx1086 movzx eax, word [ebp + 0eh] ; usOpenFlag1087 mov [esp + 6*4], eax1088 movzx ecx, word [ebp + 10h] ; usOpenMode1089 mov [esp + 5*4], ecx1090 VBOXSF_FARPTR_2_FLAT 12h, 4*4 ; psffsd (new, no short cuts)1091 VBOXSF_FARPTR_2_FLAT 16h, 3*4 ; psffsi1092 VBOXSF_FARPTR_2_FLAT 1ah, 2*4 ; pszName1093 VBOXSF_FARPTR_2_FLAT 1eh, 1*4 ; pcMaxReq1094 VBOXSF_FARPTR_2_FLAT 22h, 0*4 ; pFlag1095 call NAME(FS32_OPENPAGEFILE)1387 mov ecx, [ebp + 08h] ; Reserved 1388 mov [esp + 8*4], ecx 1389 movzx edx, word [ebp + 0ch] ; usAttr 1390 mov [esp + 7*4], edx 1391 movzx eax, word [ebp + 0eh] ; usOpenFlag 1392 mov [esp + 6*4], eax 1393 movzx ecx, word [ebp + 10h] ; usOpenMode 1394 mov [esp + 5*4], ecx 1395 VBOXSF_FARPTR_2_FLAT 12h, 4*4 ; psffsd (new, no short cuts) 1396 VBOXSF_FARPTR_2_FLAT 16h, 3*4 ; psffsi 1397 VBOXSF_FARPTR_2_FLAT 1ah, 2*4 ; pszName 1398 VBOXSF_FARPTR_2_FLAT 1eh, 1*4 ; pcMaxReq 1399 VBOXSF_FARPTR_2_FLAT 22h, 0*4 ; pFlag 1400 call NAME(FS32_OPENPAGEFILE) 1096 1401 VBOXSF_TO_16 FS_OPENPAGEFILE 1097 retf 1eh1402 retf 1eh 1098 1403 VBOXSF_EP16_END FS_OPENPAGEFILE 1099 1404 … … 1104 1409 VBOXSF_EP16_BEGIN FS_PATHINFO, 'FS_PATHINFO' 1105 1410 VBOXSF_TO_32 FS_PATHINFO, 8*4 1106 movzx ecx, word [ebp + 08h] ; cbData1107 mov [esp + 7*4], ecx1108 VBOXSF_FARPTR_2_FLAT 0ah, 6*4 ; pData1109 movzx edx, word [ebp + 0eh] ; level1110 mov [esp + 5*4], edx1111 movzx eax, word [ebp + 10h] ; iCurDirEnd1112 mov [esp + 4*4], eax1113 VBOXSF_FARPTR_2_FLAT 12h, 3*4 ; pszName1114 VBOXSF_PCDFSD_2_FLAT 16h, 2*4 ; pcdfsd1115 VBOXSF_FARPTR_2_FLAT 1ah, 1*4 ; pcdfsi1116 movzx edx, word [ebp + 1eh] ; flag1117 mov [esp], edx1118 call NAME(FS32_PATHINFO)1411 movzx ecx, word [ebp + 08h] ; cbData 1412 mov [esp + 7*4], ecx 1413 VBOXSF_FARPTR_2_FLAT 0ah, 6*4 ; pData 1414 movzx edx, word [ebp + 0eh] ; level 1415 mov [esp + 5*4], edx 1416 movsx eax, word [ebp + 10h] ; iCurDirEnd 1417 mov [esp + 4*4], eax 1418 VBOXSF_FARPTR_2_FLAT 12h, 3*4 ; pszName 1419 VBOXSF_PCDFSD_2_FLAT 16h, 2*4 ; pcdfsd 1420 VBOXSF_FARPTR_2_FLAT 1ah, 1*4 ; pcdfsi 1421 movzx edx, word [ebp + 1eh] ; flag 1422 mov [esp], edx 1423 call NAME(FS32_PATHINFO) 1119 1424 VBOXSF_TO_16 FS_PATHINFO 1120 retf 18h1425 retf 18h 1121 1426 VBOXSF_EP16_END FS_PATHINFO 1122 1427 … … 1125 1430 VBOXSF_EP16_BEGIN FS_PROCESSNAME, 'FS_PROCESSNAME' 1126 1431 VBOXSF_TO_32 FS_PROCESSNAME, 1*4 1127 VBOXSF_FARPTR_2_FLAT 08h, 0*4 ; pszName1128 call NAME(FS32_PROCESSNAME)1432 VBOXSF_FARPTR_2_FLAT 08h, 0*4 ; pszName 1433 call NAME(FS32_PROCESSNAME) 1129 1434 VBOXSF_TO_16 FS_PROCESSNAME 1130 retf 4h1435 retf 4h 1131 1436 VBOXSF_EP16_END FS_PROCESSNAME 1132 1437 … … 1136 1441 VBOXSF_EP16_BEGIN FS_READ, 'FS_READ' 1137 1442 VBOXSF_TO_32 FS_READ, 6*4 ; extra local for ULONG cbDataTmp. 1138 movzx ecx, word [ebp + 08h] ; IOflag1139 mov [esp + 4*4], ecx1140 les dx, [ebp + 0ah] ; cbDataTmp = *pcbData;1141 movzx edx, dx1142 lea ecx, [esp + 5*4] ; pcbData = &cbDataTmp1143 movzx eax, word [es:edx]1144 mov [ecx], eax1145 mov [esp + 3*4], ecx1146 mov edx, DATA321147 mov es, edx1148 VBOXSF_FARPTR_2_FLAT 0eh, 2*4 ; pbData1149 VBOXSF_PSFFSD_2_FLAT 12h, 1*4 ; psffsd1150 VBOXSF_FARPTR_2_FLAT 16h, 0*4 ; psffsi1151 call FS32_READ1152 1153 les dx, [ebp + 0ah] ; *pcbData = cbDataTmp;1154 movzx edx, dx1155 mov cx, [esp + 5*4]1156 mov [es:edx], cx1157 mov edx, DATA321158 mov es, edx1443 movzx ecx, word [ebp + 08h] ; IOflag 1444 mov [esp + 4*4], ecx 1445 les dx, [ebp + 0ah] ; cbDataTmp = *pcbData; 1446 movzx edx, dx 1447 lea ecx, [esp + 5*4] ; pcbData = &cbDataTmp 1448 movzx eax, word [es:edx] 1449 mov [ecx], eax 1450 mov [esp + 3*4], ecx 1451 mov edx, DATA32 1452 mov es, edx 1453 VBOXSF_FARPTR_2_FLAT 0eh, 2*4 ; pbData 1454 VBOXSF_PSFFSD_2_FLAT 12h, 1*4 ; psffsd 1455 VBOXSF_FARPTR_2_FLAT 16h, 0*4 ; psffsi 1456 call FS32_READ 1457 1458 les dx, [ebp + 0ah] ; *pcbData = cbDataTmp; 1459 movzx edx, dx 1460 mov cx, [esp + 5*4] 1461 mov [es:edx], cx 1462 mov edx, DATA32 1463 mov es, edx 1159 1464 1160 1465 VBOXSF_TO_16 FS_READ 1161 1162 pop es 1163 retf 12h 1466 retf 12h 1164 1467 VBOXSF_EP16_END FS_READ 1165 1468 … … 1170 1473 VBOXSF_EP16_BEGIN FS_RMDIR, 'FS_RMDIR' 1171 1474 VBOXSF_TO_32 FS_RMDIR, 4*4 1172 movzx edx, word [ebp + 08h] ; iCurDirEnd1173 mov [esp + 3*4], edx1174 VBOXSF_FARPTR_2_FLAT 0ah, 2*4 ; pszName1175 VBOXSF_PCDFSD_2_FLAT 0eh, 1*4 ; pcdfsd1176 VBOXSF_FARPTR_2_FLAT 12h, 0*4 ; pcdfsi1177 call NAME(FS32_RMDIR)1475 movsx edx, word [ebp + 08h] ; iCurDirEnd 1476 mov [esp + 3*4], edx 1477 VBOXSF_FARPTR_2_FLAT 0ah, 2*4 ; pszName 1478 VBOXSF_PCDFSD_2_FLAT 0eh, 1*4 ; pcdfsd 1479 VBOXSF_FARPTR_2_FLAT 12h, 0*4 ; pcdfsi 1480 call NAME(FS32_RMDIR) 1178 1481 VBOXSF_TO_16 FS_RMDIR 1179 retf 14h1482 retf 0eh 1180 1483 VBOXSF_EP16_END FS_RMDIR 1181 1484 … … 1186 1489 VBOXSF_EP16_BEGIN FS_SETSWAP, 'FS_SETSWAP' 1187 1490 VBOXSF_TO_32 FS_SETSWAP, 2*4 1188 VBOXSF_PSFFSD_2_FLAT 08h, 1*4 ; psffsd1189 VBOXSF_FARPTR_2_FLAT 0ch, 0*4 ; psffsi1190 call NAME(FS32_SETSWAP)1491 VBOXSF_PSFFSD_2_FLAT 08h, 1*4 ; psffsd 1492 VBOXSF_FARPTR_2_FLAT 0ch, 0*4 ; psffsi 1493 call NAME(FS32_SETSWAP) 1191 1494 VBOXSF_TO_16 FS_SETSWAP 1192 retf 8h1495 retf 8h 1193 1496 VBOXSF_EP16_END FS_SETSWAP 1194 1497 … … 1199 1502 VBOXSF_EP16_BEGIN FS_SHUTDOWN, 'FS_SHUTDOWN' 1200 1503 VBOXSF_TO_32 FS_SHUTDOWN, 3*4 1201 mov ecx, [ebp + 08h] ; type1202 mov [esp + 1*4], edx1203 movzx edx, word [ebp + 0ah] ; reserved1204 mov [esp], eax1205 call NAME(FS32_SHUTDOWN)1504 mov ecx, [ebp + 0ch] ; type 1505 mov [esp + 1*4], edx 1506 movzx edx, word [ebp + 08h] ; reserved 1507 mov [esp], eax 1508 call NAME(FS32_SHUTDOWN) 1206 1509 VBOXSF_TO_16 FS_SHUTDOWN 1207 retf 6h1510 retf 6h 1208 1511 VBOXSF_EP16_END FS_SHUTDOWN 1512 1513 1514 ;; 1515 ; @cproto int FS_VERIFYUNCNAME(USHORT type, PCSZ pszName); 1516 ; 1517 VBOXSF_EP16_BEGIN FS_VERIFYUNCNAME, 'FS_VERIFYUNCNAME' 1518 VBOXSF_TO_32 FS_VERIFYUNCNAME, 3*4 1519 VBOXSF_FARPTR_2_FLAT 08h, 1*4 ; pszDev 1520 movzx ecx, word [ebp + 0ch] ; fFlag 1521 mov [esp], ecx 1522 call NAME(FS32_VERIFYUNCNAME) 1523 VBOXSF_TO_16 FS_VERIFYUNCNAME 1524 retf 6h 1525 VBOXSF_EP16_END FS_VERIFYUNCNAME 1209 1526 1210 1527 … … 1213 1530 VBOXSF_EP16_BEGIN FS_WRITE, 'FS_WRITE' 1214 1531 VBOXSF_TO_32 FS_WRITE, 6*4 ; extra local for ULONG cbDataTmp. 1215 movzx ecx, word [ebp + 08h] ; IOflag1216 mov [esp + 4*4], ecx1217 les dx, [ebp + 0ah] ; cbDataTmp = *pcbData;1218 movzx edx, dx1219 lea ecx, [esp + 5*4] ; pcbData = &cbDataTmp1220 movzx eax, word [es:edx]1221 mov [ecx], eax1222 mov [esp + 3*4], ecx1223 mov edx, DATA321224 mov es, edx1225 VBOXSF_FARPTR_2_FLAT 0eh, 2*4 ; pbData1226 VBOXSF_PSFFSD_2_FLAT 12h, 1*4 ; psffsd1227 VBOXSF_FARPTR_2_FLAT 16h, 0*4 ; psffsi1228 call FS32_WRITE1229 1230 les dx, [ebp + 0ah] ; *pcbData = cbDataTmp;1231 movzx edx, dx1232 mov cx, [esp + 5*4]1233 mov [es:edx], cx1234 mov edx, DATA321235 mov es, edx1532 movzx ecx, word [ebp + 08h] ; IOflag 1533 mov [esp + 4*4], ecx 1534 les dx, [ebp + 0ah] ; cbDataTmp = *pcbData; 1535 movzx edx, dx 1536 lea ecx, [esp + 5*4] ; pcbData = &cbDataTmp 1537 movzx eax, word [es:edx] 1538 mov [ecx], eax 1539 mov [esp + 3*4], ecx 1540 mov edx, DATA32 1541 mov es, edx 1542 VBOXSF_FARPTR_2_FLAT 0eh, 2*4 ; pbData 1543 VBOXSF_PSFFSD_2_FLAT 12h, 1*4 ; psffsd 1544 VBOXSF_FARPTR_2_FLAT 16h, 0*4 ; psffsi 1545 call FS32_WRITE 1546 1547 les dx, [ebp + 0ah] ; *pcbData = cbDataTmp; 1548 movzx edx, dx 1549 mov cx, [esp + 5*4] 1550 mov [es:edx], cx 1551 mov edx, DATA32 1552 mov es, edx 1236 1553 1237 1554 VBOXSF_TO_16 FS_WRITE 1238 1239 pop es 1240 retf 12h 1555 retf 12h 1241 1556 VBOXSF_EP16_END FS_WRITE 1242 1557 1558 1559 ; 1560 ; 1561 ; Calling 16-bit kernel code. 1562 ; 1563 ; 1564 1565 BEGINCODE 1566 1567 ;; 1568 ; Wrapper around FSH_GETVOLPARM. 1569 ; 1570 ; @returns VPBFSD. 1571 ; @param hVbp The volume handle to resolve. 1572 ; @param ppVbpFsi 1573 ; 1574 BEGINPROC Fsh32GetVolParams 1575 VBOXSF_FROM_32 Fsh32GetVolParams, 2*4 1576 mov di, sp ; make the top of the stack addressable via di 1577 1578 mov [ss:di], eax ; clear the return variables 1579 mov [ss:di + 4], eax 1580 1581 mov ax, [bp + 8] ; hVbp 1582 push ax 1583 1584 lea ax, [ss:di] ; &hvfsi 1585 push ss 1586 push ax 1587 1588 lea ax, [ss:di + 4] ; &hvfsd 1589 push ss 1590 push ax 1591 1592 call far FSH_GETVOLPARM 1593 1594 mov sp, di ; paranoia (pascal pops params) 1595 1596 VBOXSF_FROM_16_SWITCH Fsh32GetVolParams 1597 1598 ; Convert vpfsi to flat and store it in return location. 1599 mov ebx, [ebp + 0ch] 1600 test ebx, ebx 1601 jz .no_vpfsi 1602 call KernSelToFlat 1603 mov [ebx], eax 1604 .no_vpfsi: 1605 add esp, 4 1606 1607 ; Convert vpfsd to flat and return it. 1608 call KernSelToFlat 1609 1610 VBOXSF_FROM_16_EPILOGUE 1611 ret 1612 ENDPROC Fsh32GetVolParams 1243 1613 1244 1614 … … 1264 1634 VBOXSF_EP16_BEGIN FS_INIT, 'FS_INIT' 1265 1635 ; DEBUG_STR16 'VBoxSF: FS_INIT - enter' 1266 push ebp1267 mov ebp, esp1268 push ds ; bp - 02h1269 push es ; bp - 04h1270 push esi ; bp - 08h1271 push edi ; bp - 0ch1272 1273 mov ax, DATA161274 mov ds, ax1275 mov es, ax1276 1277 ;1278 ; Save the device help entry point.1279 ;1280 mov eax, [bp + 0ch]1281 mov [NAME(g_fpfnDevHlp)], eax1282 1283 ;1284 ; Parse the command line.1285 ; Doing this in assembly is kind of ugly...1286 ;1287 cmp word [bp + 10h + 2], 31288 jbe near .no_command_line1289 lds si, [bp + 10h] ; ds:si -> command line iterator.1636 push ebp 1637 mov ebp, esp 1638 push ds ; bp - 02h 1639 push es ; bp - 04h 1640 push esi ; bp - 08h 1641 push edi ; bp - 0ch 1642 1643 mov ax, DATA16 1644 mov ds, ax 1645 mov es, ax 1646 1647 ; 1648 ; Save the device help entry point. 1649 ; 1650 mov eax, [bp + 0ch] 1651 mov [NAME(g_fpfnDevHlp)], eax 1652 1653 ; 1654 ; Parse the command line. 1655 ; Doing this in assembly is kind of ugly... 1656 ; 1657 cmp word [bp + 10h + 2], 3 1658 jbe near .no_command_line 1659 lds si, [bp + 10h] ; ds:si -> command line iterator. 1290 1660 .parse_next: 1291 1661 1292 ; skip leading blanks.1662 ; skip leading blanks. 1293 1663 .parse_next_char: 1294 mov di, si ; DI = start of argument.1295 lodsb1296 cmp al, ' '1297 je .parse_next_char1298 cmp al, 9 ; tab1299 je .parse_next_char1300 cmp al, 01301 je near .parse_done1302 1303 ; check for '/' or '-'1304 cmp al, '/'1305 je .parse_switch1306 cmp al, '-'1307 je .parse_switch1308 jmp .parse_error1309 1310 ; parse switches.1664 mov di, si ; DI = start of argument. 1665 lodsb 1666 cmp al, ' ' 1667 je .parse_next_char 1668 cmp al, 9 ; tab 1669 je .parse_next_char 1670 cmp al, 0 1671 je near .parse_done 1672 1673 ; check for '/' or '-' 1674 cmp al, '/' 1675 je .parse_switch 1676 cmp al, '-' 1677 je .parse_switch 1678 jmp .parse_error 1679 1680 ; parse switches. 1311 1681 .parse_switch: 1312 lodsb1313 cmp al, 01314 je .parse_error1315 and al, ~20h ; uppercase1316 1317 cmp al, 'V' ; /V - verbose1318 je .parse_verbose1319 cmp al, 'Q' ; /Q - quiet.1320 je .parse_quiet1321 jmp .parse_error1682 lodsb 1683 cmp al, 0 1684 je .parse_error 1685 and al, ~20h ; uppercase 1686 1687 cmp al, 'V' ; /V - verbose 1688 je .parse_verbose 1689 cmp al, 'Q' ; /Q - quiet. 1690 je .parse_quiet 1691 jmp .parse_error 1322 1692 1323 1693 .parse_verbose: 1324 mov byte [es:NAME(g_fVerbose)], 11325 jmp .parse_next1694 mov byte [es:NAME(g_fVerbose)], 1 1695 jmp .parse_next 1326 1696 1327 1697 .parse_quiet: 1328 mov byte [es:NAME(g_fVerbose)], 01329 jmp .parse_next1698 mov byte [es:NAME(g_fVerbose)], 0 1699 jmp .parse_next 1330 1700 1331 1701 .parse_error: 1332 1702 segment DATA16 1333 1703 .szSyntaxError: 1334 db 0dh, 0ah, 'VBoxSF.ifs: command line parse error at: ', 01704 db 0dh, 0ah, 'VBoxSF.ifs: command line parse error at: ', 0 1335 1705 .szNewLine: 1336 db 0dh, 0ah, 0dh, 0ah, 01706 db 0dh, 0ah, 0dh, 0ah, 0 1337 1707 segment CODE16 1338 mov bx, .szSyntaxError1339 call NAME(FS_INIT_FPUTS)1340 1341 push es1342 push ds1343 pop es1344 mov bx, di1345 call NAME(FS_INIT_FPUTS)1346 pop es1347 1348 mov bx, .szNewLine1349 call NAME(FS_INIT_FPUTS)1350 1351 mov ax, ERROR_INVALID_PARAMETER1352 jmp .done1708 mov bx, .szSyntaxError 1709 call NAME(FS_INIT_FPUTS) 1710 1711 push es 1712 push ds 1713 pop es 1714 mov bx, di 1715 call NAME(FS_INIT_FPUTS) 1716 pop es 1717 1718 mov bx, .szNewLine 1719 call NAME(FS_INIT_FPUTS) 1720 1721 mov ax, ERROR_INVALID_PARAMETER 1722 jmp .done 1353 1723 1354 1724 .parse_done: 1355 mov ax, DATA161356 mov ds, ax1725 mov ax, DATA16 1726 mov ds, ax 1357 1727 .no_command_line: 1358 1728 1359 ;1360 ; Write our greeting to STDOUT.1361 ; APIRET _Pascal DosWrite(HFILE hf, PVOID pvBuf, USHORT cbBuf, PUSHORT pcbBytesWritten);1362 ;1363 cmp byte [NAME(g_fVerbose)], 01364 je near .quiet1729 ; 1730 ; Write our greeting to STDOUT. 1731 ; APIRET _Pascal DosWrite(HFILE hf, PVOID pvBuf, USHORT cbBuf, PUSHORT pcbBytesWritten); 1732 ; 1733 cmp byte [NAME(g_fVerbose)], 0 1734 je near .quiet 1365 1735 segment DATA16 1366 1736 .szMessage: 1367 db 'VirtualBox Guest Additions IFS for OS/2', 0dh, 0ah, 01737 db 'VirtualBox Guest Additions IFS for OS/2', 0dh, 0ah, 0 1368 1738 segment CODE16 1369 mov bx, .szMessage1370 call NAME(FS_INIT_FPUTS)1739 mov bx, .szMessage 1740 call NAME(FS_INIT_FPUTS) 1371 1741 .quiet: 1372 1742 1373 ; return success.1374 xor eax, eax1743 ; return success. 1744 xor eax, eax 1375 1745 .done: 1376 lea sp, [bp - 0ch]1377 pop edi1378 pop esi1379 pop es1380 pop ds1381 mov esp, ebp1382 pop ebp1383 DEBUG_STR16 'VBoxSF: FS_INIT - leave'1384 retf 0ch1746 lea sp, [bp - 0ch] 1747 pop edi 1748 pop esi 1749 pop es 1750 pop ds 1751 mov esp, ebp 1752 pop ebp 1753 DEBUG_STR16 'VBoxSF: FS_INIT - leave' 1754 retf 0ch 1385 1755 VBOXSF_EP16_END FS_INIT 1386 1756 … … 1392 1762 ; @uses nothing. 1393 1763 GLOBALNAME FS_INIT_FPUTS 1394 push bp1395 mov bp, sp1396 push es ; bp - 02h1397 push ds ; bp - 04h1398 push ax ; bp - 06h1399 push bx ; bp - 08h1400 push cx ; bp - 0ah1401 push dx ; bp - 0ch1402 push si ; bp - 0eh1403 push di ; bp - 10h1404 1405 ; cx = strlen(es:bx)1406 xor al, al1407 mov di, bx1408 mov cx, 0ffffh1409 cld1410 repne scasb1411 not cx1412 dec cx1413 1414 ; APIRET _Pascal DosWrite(HFILE hf, PVOID pvBuf, USHORT cbBuf, PUSHORT pcbBytesWritten);1415 push cx1416 mov ax, sp ; cbBytesWritten1417 push 1 ; STDOUT1418 push es ; pvBuf1419 push bx1420 push cx ; cbBuf1421 push ss ; pcbBytesWritten1422 push ax1764 push bp 1765 mov bp, sp 1766 push es ; bp - 02h 1767 push ds ; bp - 04h 1768 push ax ; bp - 06h 1769 push bx ; bp - 08h 1770 push cx ; bp - 0ah 1771 push dx ; bp - 0ch 1772 push si ; bp - 0eh 1773 push di ; bp - 10h 1774 1775 ; cx = strlen(es:bx) 1776 xor al, al 1777 mov di, bx 1778 mov cx, 0ffffh 1779 cld 1780 repne scasb 1781 not cx 1782 dec cx 1783 1784 ; APIRET _Pascal DosWrite(HFILE hf, PVOID pvBuf, USHORT cbBuf, PUSHORT pcbBytesWritten); 1785 push cx 1786 mov ax, sp ; cbBytesWritten 1787 push 1 ; STDOUT 1788 push es ; pvBuf 1789 push bx 1790 push cx ; cbBuf 1791 push ss ; pcbBytesWritten 1792 push ax 1423 1793 %if 0 ; wlink/nasm generates a non-aliased fixup here which results in 16-bit offset with the flat 32-bit selector. 1424 call far DOS16WRITE1794 call far DOS16WRITE 1425 1795 %else 1426 ; convert flat pointer to a far pointer using the tiled algorithm.1427 mov ax, DATA32 wrt FLAT1428 mov ds, ax1429 mov eax, g_pfnDos16Write wrt FLAT1430 movzx eax, word [eax + 2] ; High word of the flat address (in DATA32).1431 shl ax, 31432 or ax, 0007h1433 mov dx, DATA161434 mov ds, dx1435 mov [NAME(g_fpfnDos16Write) + 2], ax ; Update the selector (in DATA16).1436 ; do the call1437 call far [NAME(g_fpfnDos16Write)]1796 ; convert flat pointer to a far pointer using the tiled algorithm. 1797 mov ax, DATA32 wrt FLAT 1798 mov ds, ax 1799 mov eax, g_pfnDos16Write wrt FLAT 1800 movzx eax, word [eax + 2] ; High word of the flat address (in DATA32). 1801 shl ax, 3 1802 or ax, 0007h 1803 mov dx, DATA16 1804 mov ds, dx 1805 mov [NAME(g_fpfnDos16Write) + 2], ax ; Update the selector (in DATA16). 1806 ; do the call 1807 call far [NAME(g_fpfnDos16Write)] 1438 1808 %endif 1439 1809 1440 lea sp, [bp - 10h]1441 pop di1442 pop si1443 pop dx1444 pop cx1445 pop bx1446 pop ax1447 pop ds1448 pop es1449 pop bp1450 ret1810 lea sp, [bp - 10h] 1811 pop di 1812 pop si 1813 pop dx 1814 pop cx 1815 pop bx 1816 pop ax 1817 pop ds 1818 pop es 1819 pop bp 1820 ret 1451 1821 ENDPROC FS_INIT_FPUTS 1452 1822 … … 1459 1829 ; 1460 1830 GLOBALNAME VBoxSFR0Init16Bit 1461 DEBUG_STR16 'VBoxSF: VBoxSFR0Init16Bit - enter'1462 push ds1463 push es1464 push fs1465 push gs1466 push esi1467 push edi1468 push ebp1469 mov ebp, esp1470 and sp, 0fffch1471 1472 ;1473 ; Only try once.1474 ;1475 mov ax, DATA161476 mov ds, ax1477 mov byte [NAME(g_fDoneRing0)], 11478 1479 ;1480 ; Try attach to the VBoxGuest driver.1481 ;1482 mov bx, NAME(g_szVBoxGuestName)1483 mov di, NAME(g_VBoxGuestAttachDD)1484 mov dl, DevHlp_AttachDD1485 call far [NAME(g_fpfnDevHlp)]1486 jc .attach_attempt_done1487 1488 push seg NAME(g_VBoxGuestIDC)1489 push NAME(g_VBoxGuestIDC)1490 call far [NAME(g_VBoxGuestAttachDD) + 6]1831 DEBUG_STR16 'VBoxSF: VBoxSFR0Init16Bit - enter' 1832 push ds 1833 push es 1834 push fs 1835 push gs 1836 push esi 1837 push edi 1838 push ebp 1839 mov ebp, esp 1840 and sp, 0fffch 1841 1842 ; 1843 ; Only try once. 1844 ; 1845 mov ax, DATA16 1846 mov ds, ax 1847 mov byte [NAME(g_fDoneRing0)], 1 1848 1849 ; 1850 ; Try attach to the VBoxGuest driver. 1851 ; 1852 mov bx, NAME(g_szVBoxGuestName) 1853 mov di, NAME(g_VBoxGuestAttachDD) 1854 mov dl, DevHlp_AttachDD 1855 call far [NAME(g_fpfnDevHlp)] 1856 jc .attach_attempt_done 1857 1858 push seg NAME(g_VBoxGuestIDC) 1859 push NAME(g_VBoxGuestIDC) 1860 call far [NAME(g_VBoxGuestAttachDD) + 6] 1491 1861 .attach_attempt_done: 1492 1862 1493 1863 %ifndef DONT_LOCK_SEGMENTS 1494 ;1495 ; Lock the two 16-bit segments.1496 ;1497 push DATA161498 call far FSH_FORCENOSWAP1499 push CODE161500 call far FSH_FORCENOSWAP1501 ; Wonder if this'll work if wlink could mark the two segments as ALIASed...1502 ;push DATA321503 ;call far FSH_FORCENOSWAP1504 ;push TEXT321505 ;call far FSH_FORCENOSWAP1864 ; 1865 ; Lock the two 16-bit segments. 1866 ; 1867 push DATA16 1868 call far FSH_FORCENOSWAP 1869 push CODE16 1870 call far FSH_FORCENOSWAP 1871 ; Wonder if this'll work if wlink could mark the two segments as ALIASed... 1872 ;push DATA32 1873 ;call far FSH_FORCENOSWAP 1874 ;push TEXT32 1875 ;call far FSH_FORCENOSWAP 1506 1876 %endif 1507 1877 1508 ;1509 ; Do 32-bit ring-0 init.1510 ;1511 ;jmp far dword NAME(VBoxSFR0Init16Bit_32) wrt FLAT1512 db 066h1513 db 0eah1514 dd NAME(VBoxSFR0Init16Bit_32) ;wrt FLAT1515 dw TEXT32 wrt FLAT1878 ; 1879 ; Do 32-bit ring-0 init. 1880 ; 1881 ;jmp far dword NAME(VBoxSFR0Init16Bit_32) wrt FLAT 1882 db 066h 1883 db 0eah 1884 dd NAME(VBoxSFR0Init16Bit_32) ;wrt FLAT 1885 dw TEXT32 wrt FLAT 1516 1886 segment TEXT32 1517 1887 GLOBALNAME VBoxSFR0Init16Bit_32 1518 mov ax, DATA32 wrt FLAT1519 mov ds, ax1520 mov es, ax1521 1522 call KernThunkStackTo321523 call NAME(VBoxSFR0Init)1524 call KernThunkStackTo161525 1526 ;jmp far dword NAME(VBoxSFR0Init16Bit_16) wrt CODE161527 db 066h1528 db 0eah1529 dw NAME(VBoxSFR0Init16Bit_16) wrt CODE161530 dw CODE161888 mov ax, DATA32 wrt FLAT 1889 mov ds, ax 1890 mov es, ax 1891 1892 call KernThunkStackTo32 1893 call NAME(VBoxSFR0Init) 1894 call KernThunkStackTo16 1895 1896 ;jmp far dword NAME(VBoxSFR0Init16Bit_16) wrt CODE16 1897 db 066h 1898 db 0eah 1899 dw NAME(VBoxSFR0Init16Bit_16) wrt CODE16 1900 dw CODE16 1531 1901 segment CODE16 1532 1902 GLOBALNAME VBoxSFR0Init16Bit_16 1533 1903 1534 mov esp, ebp1535 pop ebp1536 pop edi1537 pop esi1538 pop gs1539 pop fs1540 pop es1541 pop ds1542 DEBUG_STR16 'VBoxSF: VBoxSFR0Init16Bit - leave'1543 ret1904 mov esp, ebp 1905 pop ebp 1906 pop edi 1907 pop esi 1908 pop gs 1909 pop fs 1910 pop es 1911 pop ds 1912 DEBUG_STR16 'VBoxSF: VBoxSFR0Init16Bit - leave' 1913 ret 1544 1914 ENDPROC VBoxSFR0Init16Bit 1545 1915 … … 1551 1921 ; 1552 1922 GLOBALNAME dbgstr16 1553 push ds1554 push ebx1555 push edx1556 1557 mov bx, ax1558 mov dx, 0504h ; RTLOG_DEBUG_PORT1559 mov ax, DATA161560 mov ds, ax1923 push ds 1924 push ebx 1925 push edx 1926 1927 mov bx, ax 1928 mov dx, 0504h ; RTLOG_DEBUG_PORT 1929 mov ax, DATA16 1930 mov ds, ax 1561 1931 1562 1932 .next: 1563 mov al, [bx]1564 or al, al1565 jz .done1566 inc bx1567 out dx, al1568 jmp .next1933 mov al, [bx] 1934 or al, al 1935 jz .done 1936 inc bx 1937 out dx, al 1938 jmp .next 1569 1939 1570 1940 .done: 1571 pop edx1572 pop ebx1573 pop ds1574 ret1941 pop edx 1942 pop ebx 1943 pop ds 1944 ret 1575 1945 ENDPROC dbgstr16 1576 1946 %endif 1577 1947 1948 1949 %ifdef WITH_DWARF 1950 ; 1951 ; Close debug info 1952 ; 1953 segment _debug_info 1954 db 0 1955 g_dwarf_compile_unit_end: 1956 %endif 1957
Note:
See TracChangeset
for help on using the changeset viewer.