Changeset 13421 in vbox
- Timestamp:
- Oct 21, 2008 9:26:26 AM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile.kmk
r13375 r13421 765 765 Serial/DrvHostSerial.cpp 766 766 767 if defined(VBOX_WITH_NETFLT) && "$(KBUILD_TARGET)" == "win"767 if defined(VBOX_WITH_NETFLT) 768 768 if defined(VBOX_NETFLT_ONDEMAND_BIND) 769 Drivers_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND 770 else 771 Drivers_SOURCES.win += Network/win/DrvIntNet-win.cpp 772 endif 769 Drivers_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND 770 endif 771 Drivers_SOURCES.win += Network/win/DrvIntNet-win.cpp 773 772 endif 774 773 … … 877 876 ServicesR0_SOURCES = \ 878 877 Network/SrvIntNetR0.cpp 878 879 if defined(VBOX_WITH_NETFLT) 880 ServicesR0_SOURCES.win.amd64 += Network/win/SrvIntNetR0A-win.asm 881 ServicesR0_DEFS.win.amd64 += SUPDRV_WITH_UNWIND_HACK 882 endif 883 879 884 880 885 # -
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r11236 r13421 3301 3301 3302 3302 3303 3304 3303 #ifdef SUPDRV_WITH_UNWIND_HACK 3304 # if defined(RT_OS_WINDOWS) && defined(RT_ARCH_AMD64) 3305 # define INTNET_DECL_CALLBACK(type) DECLASM(DECLHIDDEN(type)) 3306 # define INTNET_CALLBACK(_n) intnetNtWrap##_n 3307 3308 /* wrapper callback declarations */ 3309 INTNET_DECL_CALLBACK(bool) INTNET_CALLBACK(intnetR0TrunkIfPortSetSGPhys)(PINTNETTRUNKSWPORT pSwitchPort, bool fEnable); 3310 INTNET_DECL_CALLBACK(bool) INTNET_CALLBACK(intnetR0TrunkIfPortRecv)(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG, uint32_t fSrc); 3311 INTNET_DECL_CALLBACK(void) INTNET_CALLBACK(intnetR0TrunkIfPortSGRetain)(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG); 3312 INTNET_DECL_CALLBACK(void) INTNET_CALLBACK(intnetR0TrunkIfPortSGRelease)(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG); 3313 3314 # else 3315 # error "UNSUPPORTED (SUPDRV_WITH_UNWIND_HACK)" 3316 # endif 3317 #else 3318 # define INTNET_DECL_CALLBACK(_t) static DECLCALLBACK(_t) 3319 # define INTNET_CALLBACK(_n) _n 3320 #endif 3305 3321 3306 3322 /** @copydoc INTNETTRUNKSWPORT::pfnSetSGPhys */ 3307 static DECLCALLBACK(bool) intnetR0TrunkIfPortSetSGPhys(PINTNETTRUNKSWPORT pSwitchPort, bool fEnable)3323 INTNET_DECL_CALLBACK(bool) intnetR0TrunkIfPortSetSGPhys(PINTNETTRUNKSWPORT pSwitchPort, bool fEnable) 3308 3324 { 3309 3325 PINTNETTRUNKIF pThis = INTNET_SWITCHPORT_2_TRUNKIF(pSwitchPort); … … 3314 3330 3315 3331 /** @copydoc INTNETTRUNKSWPORT::pfnRecv */ 3316 static DECLCALLBACK(bool) intnetR0TrunkIfPortRecv(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG, uint32_t fSrc)3332 INTNET_DECL_CALLBACK(bool) intnetR0TrunkIfPortRecv(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG, uint32_t fSrc) 3317 3333 { 3318 3334 PINTNETTRUNKIF pThis = INTNET_SWITCHPORT_2_TRUNKIF(pSwitchPort); … … 3345 3361 3346 3362 /** @copydoc INTNETTRUNKSWPORT::pfnSGRetain */ 3347 static DECLCALLBACK(void) intnetR0TrunkIfPortSGRetain(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG)3363 INTNET_DECL_CALLBACK(void) intnetR0TrunkIfPortSGRetain(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG) 3348 3364 { 3349 3365 PINTNETTRUNKIF pThis = INTNET_SWITCHPORT_2_TRUNKIF(pSwitchPort); … … 3362 3378 3363 3379 /** @copydoc INTNETTRUNKSWPORT::pfnSGRelease */ 3364 static DECLCALLBACK(void) intnetR0TrunkIfPortSGRelease(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG)3380 INTNET_DECL_CALLBACK(void) intnetR0TrunkIfPortSGRelease(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG) 3365 3381 { 3366 3382 PINTNETTRUNKIF pThis = INTNET_SWITCHPORT_2_TRUNKIF(pSwitchPort); … … 3592 3608 return VERR_NO_MEMORY; 3593 3609 pTrunkIF->SwitchPort.u32Version = INTNETTRUNKSWPORT_VERSION; 3594 pTrunkIF->SwitchPort.pfnSetSGPhys = intnetR0TrunkIfPortSetSGPhys;3595 pTrunkIF->SwitchPort.pfnRecv = intnetR0TrunkIfPortRecv;3596 pTrunkIF->SwitchPort.pfnSGRetain = intnetR0TrunkIfPortSGRetain;3597 pTrunkIF->SwitchPort.pfnSGRelease = intnetR0TrunkIfPortSGRelease;3610 pTrunkIF->SwitchPort.pfnSetSGPhys = INTNET_CALLBACK(intnetR0TrunkIfPortSetSGPhys); 3611 pTrunkIF->SwitchPort.pfnRecv = INTNET_CALLBACK(intnetR0TrunkIfPortRecv); 3612 pTrunkIF->SwitchPort.pfnSGRetain = INTNET_CALLBACK(intnetR0TrunkIfPortSGRetain); 3613 pTrunkIF->SwitchPort.pfnSGRelease = INTNET_CALLBACK(intnetR0TrunkIfPortSGRelease); 3598 3614 pTrunkIF->SwitchPort.u32VersionEnd = INTNETTRUNKSWPORT_VERSION; 3599 3615 //pTrunkIF->pIfPort = NULL; -
trunk/src/VBox/HostDrivers/Support/win/SUPDrvA-win.asm
r12161 r13421 32 32 ;* Header Files * 33 33 ;******************************************************************************* 34 %include "iprt/ asmdefs.mac"34 %include "iprt/ntwrap.mac" 35 35 36 36 BEGINCODE … … 52 52 %ifdef RT_ARCH_AMD64 53 53 54 ;; 55 ; Common prolog, take the proc name as argument. 56 ; This creates a 0x80 byte stack frame. 57 ; 58 %macro NtWrapProlog 1 59 [proc_frame %1] 60 push rbp 61 [pushreg rbp] 62 mov rbp, rsp 63 [setframe rbp, 0] 64 sub rsp, 0x80 65 [allocstack 0x80] 66 67 ; save rdi and load rbp into it 68 mov [rbp - 8h], rdi 69 [savereg rdi, 0x78] 70 mov rdi, rbp 71 [endprolog] 72 %endmacro 73 74 ;; 75 ; Common epilog, take the proc name as argument. 76 %macro NtWrapEpilog 1 77 ; restore rbp and rdi then return. 78 mov rbp, rdi 79 mov rdi, [rdi - 8h] 80 leave 81 ret 82 [endproc_frame %1] 83 %endmacro 84 85 ;; 86 ; Create a stack marker with the rbp. The marker is 32 byte big. 87 ; This is 32-byte aligned and 32 byte in size. 88 ; 89 ; Trashes r10 90 %macro NtWrapCreateMarker 0 91 lea r10, [rbp - 30h] 92 and r10, ~1fh ; 32-byte align it. 93 mov dword [r10 ], 0x20080901 94 mov dword [r10 + 04h], 0x20080902 95 mov qword [r10 + 08h], rbp 96 mov dword [r10 + 10h], 0x20080903 97 mov dword [r10 + 14h], 0x20080904 98 mov qword [r10 + 18h], rbp 99 %endmacro 100 101 ;; 102 ; Destroys the stack marker. 103 ; 104 ; Trashes r10 105 %macro NtWrapDestroyMarker 0 106 lea r10, [rbp - 30h] 107 and r10, ~1fh ; 32-byte align it. 108 mov [r10 ], rbp 109 mov [r10 + 08h], rbp 110 mov [r10 + 10h], rbp 111 mov [r10 + 18h], rbp 112 %endmacro 113 114 ;; 115 ; Find the stack marker with the rbp of the entry frame. 116 ; 117 ; Search the current stack page inline, call a helper function 118 ; which does a safe search of any further stack pages. 119 ; 120 ; Trashes rax, r10 and r11. 121 ; Modifies rbp 122 ; 123 %macro NtWrapLocateMarker 0 124 mov rax, rbp 125 and rax, ~1fh ; 32-byte align it. 126 127 ; 128 ; Calc remainig space in the current page. If we're on a 129 ; page boundrary, we'll search the entire previous page. 130 ; 131 mov r10, rax 132 neg r10 133 and r10, 0fffh 134 inc r10 135 shr r10, 5 ; /= 32 bytes 136 jz %%not_found ; If zero, take the slow path 137 138 ; 139 ; The search loop. 140 ; 141 %%again: 142 dec r10 143 lea rax, [rax + 20h] 144 jz %%not_found 145 cmp dword [rax ], 0x20080901 146 je %%candidate 147 jmp %%again 148 149 %%not_found: 150 call NAME(NtWrapLocateMarkerHelper) 151 jmp %%done 152 153 %%candidate: 154 cmp dword [rax + 04h], 0x20080902 155 jne %%again 156 cmp dword [rax + 10h], 0x20080903 157 jne %%again 158 cmp dword [rax + 14h], 0x20080904 159 jne %%again 160 mov r11, [rax + 08h] 161 cmp r11, [rax + 18h] 162 jne %%again 163 164 ; found it, change rbp. 165 mov rbp, r11 166 %%done: 167 %endmacro 168 169 ;; 170 ; Wraps a function with 4 or less argument that will go into registers. 171 %macro NtWrapFunctionWithAllRegParams 1 172 extern NAME(%1) 173 BEGINPROC supdrvNtWrap%1 174 NtWrapProlog supdrvNtWrap%1 175 NtWrapLocateMarker 176 177 call NAME(%1) 178 179 NtWrapEpilog supdrvNtWrap%1 180 ENDPROC supdrvNtWrap%1 181 %endmacro 182 183 ;; 184 ; Wraps a function with 5 argument, where the first 4 goes into registers. 185 %macro NtWrapFunctionWith5Params 1 186 extern NAME(%1) 187 BEGINPROC supdrvNtWrap%1 188 NtWrapProlog supdrvNtWrap%1 189 NtWrapLocateMarker 190 191 mov r11, [rdi + 30h] 192 mov [rsp + 20h], r11 193 call NAME(%1) 194 195 NtWrapEpilog supdrvNtWrap%1 196 ENDPROC supdrvNtWrap%1 197 %endmacro 198 199 ;; 200 ; Wraps a function with 6 argument, where the first 4 goes into registers. 201 %macro NtWrapFunctionWith6Params 1 202 extern NAME(%1) 203 BEGINPROC supdrvNtWrap%1 204 NtWrapProlog supdrvNtWrap%1 205 NtWrapLocateMarker 206 207 mov r11, [rdi + 30h] 208 mov [rsp + 20h], r11 209 mov r10, [rdi + 38h] 210 mov [rsp + 28h], r10 211 call NAME(%1) 212 213 NtWrapEpilog supdrvNtWrap%1 214 ENDPROC supdrvNtWrap%1 215 %endmacro 216 217 ;; 218 ; Wraps a function with 7 argument, where the first 4 goes into registers. 219 %macro NtWrapFunctionWith7Params 1 220 extern NAME(%1) 221 BEGINPROC supdrvNtWrap%1 222 NtWrapProlog supdrvNtWrap%1 223 NtWrapLocateMarker 224 225 mov r11, [rdi + 30h] 226 mov [rsp + 20h], r11 227 mov r10, [rdi + 38h] 228 mov [rsp + 28h], r10 229 mov rax, [rdi + 40h] 230 mov [rsp + 30h], rax 231 call NAME(%1) 232 233 NtWrapEpilog supdrvNtWrap%1 234 ENDPROC supdrvNtWrap%1 235 %endmacro 236 237 extern IoGetStackLimits 238 239 ;; 240 ; Helper that cautiously continues the stack marker search 241 ; NtWrapLocateMarker started. 242 ; 243 ; The stack layout at the time is something like this. 244 ; rbp+08h callers return address. 245 ; rbp-00h saved rbp 246 ; rbp-08h saved rdi 247 ; rbp-09h 248 ; thru unused. 249 ; rbp-80h 250 ; rbp-88h our return address. 251 ; rbp-89h 252 ; thru callee register dump zone. 253 ; rbp-a0h 254 ; 255 ; @param rax Current stack location. 256 ; @param rdi Parent stack frame pointer. (This should equal rbp on entry.) 257 ; 258 ; Trashes: rax, r10, r11. 259 ; Will use the callers stack frame for register saving ASSUMING that 260 ; rbp-80h thru rbp-09h is unused. 261 ; 262 ; Modifies: rbp 263 ; 264 BEGINPROC NtWrapLocateMarkerHelper 265 ; 266 ; Prolog. Save volatile regs and reserve callee space. 267 ; 268 sub rsp, 20h ; For IoGetStackLimits(). 269 mov [rdi - 80h], rax 270 mov [rdi - 78h], rcx 271 mov [rdi - 70h], rdx 272 mov [rdi - 68h], r8 273 mov [rdi - 60h], r9 274 275 ; 276 ; Call VOID IoGetStackLimits(OUT PULONG_PTR LowLimit, OUT PULONG_PTR HighLimit); 277 ; 278 ; Use rdi-40h for the high limit and rdi-50h for the low one, we're only 279 ; interested in the high one. 280 ; 281 lea rcx, [rdi - 40h] ; arg #1 LowLimit 282 lea rdx, [rdi - 50h] ; arg #2 HighLimit 283 mov [rdx], eax ; paranoia - init to end of current search. 284 call IoGetStackLimits 285 286 ; 287 ; Move the top address into r10, restore rax and continue 288 ; the search. Check that r10 is less than 3 pages from rax. 289 ; 290 mov rax, [rdi - 80h] ; Restore eax (see prolog) 291 mov r10, [rdi - 50h] ; HighLimit 292 and r10, ~1fh ; 32-byte align it (downwards) 293 sub r10, rax 294 jz .not_found ; If already at the top of the stack. 295 cmp r10, 3000h 296 jae .out_of_bounds ; If too far away, something is busted. 297 shr r10, 5 ; /= 32. 298 299 ; The loop body. 300 .search_loop: 301 cmp dword [rax ], 0x20080901 302 je .candidate 303 .continue_searching: 304 dec r10 305 jz .not_found 306 lea rax, [rax + 20h] 307 jmp .search_loop 308 309 ; Found the first marker, check for the rest. 310 .candidate: 311 cmp dword [rax + 04h], 0x20080902 312 jne .continue_searching 313 cmp dword [rax + 10h], 0x20080903 314 jne .continue_searching 315 cmp dword [rax + 14h], 0x20080904 316 jne .continue_searching 317 mov r11, [rax + 08h] 318 cmp r11, [rax + 18h] 319 jne .continue_searching 320 321 ; found it, change rbp. 322 mov rbp, r11 323 324 ; 325 ; Restore registers and pop the stack frame. 326 ; 327 .epilog: 328 mov r9, [rdi - 60h] 329 mov r8, [rdi - 68h] 330 mov rdx, [rdi - 70h] 331 mov rcx, [rdi - 78h] 332 ; mov rax, [rdi - 80h] 333 add rsp, 20h 334 ret 335 336 ; 337 ; Needless to say, this isn't supposed to happen. Thus the int3. 338 ; Note down r10 and rax. 339 ; 340 .out_of_bounds: 341 %ifdef DEBUG 342 int3 54 ; 55 ; This has the same order as the list in SUPDrv.c 56 ; 57 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ComponentRegisterFactory 58 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ComponentDeregisterFactory 59 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ComponentQueryFactory 60 NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, SUPR0ObjRegister 61 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ObjAddRef 62 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ObjRelease 63 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ObjVerifyAccess 64 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0LockMem 65 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0UnlockMem 66 NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, SUPR0ContAlloc 67 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ContFree 68 NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, SUPR0LowAlloc 69 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0LowFree 70 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0MemAlloc 71 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0MemGetPhys 72 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0MemFree 73 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0PageAlloc 74 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0PageFree 75 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0Printf - cannot wrap this buster. 76 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemAlloc 77 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemAllocZ 78 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemFree 79 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemDup 80 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemDupEx 81 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemRealloc 82 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocLow 83 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocPage 84 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocPhys 85 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocPhysNC 86 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocCont 87 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjLockUser 88 NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, RTR0MemObjMapKernel 89 NtWrapDyn2DrvFunctionWith6Params supdrvNtWrap, RTR0MemObjMapUser 90 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAddress - not necessary 91 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAddressR3 - not necessary 92 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjSize - not necessary 93 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjIsMapping - not necessary 94 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjGetPagePhysAddr - not necessary 95 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjFree 96 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTProcSelf - not necessary 97 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0ProcHandleSelf - not necessary 98 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexCreate 99 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexDestroy 100 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexRequest 101 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexRelease 102 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventCreate 103 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventSignal 104 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventWait 105 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventWaitNoResume 106 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventDestroy 107 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiCreate 108 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiSignal 109 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiReset 110 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiWait 111 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiWaitNoResume 112 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiDestroy 113 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockCreate 114 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockDestroy 115 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockAcquire 116 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockRelease 117 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockAcquireNoInts 118 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockReleaseNoInts 119 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeNanoTS - not necessary 120 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeMilliTS - not necessary 121 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeSystemNanoTS - not necessary 122 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeSystemMilliTS - not necessary 123 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadNativeSelf - not necessary 124 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadSleep 125 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadYield 126 %if 0 ; Thread APIs, Part 2 127 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadSelf 128 NtWrapDyn2DrvFunctionWith7Params supdrvNtWrap, RTThreadCreate 129 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadGetNative 130 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadWait 131 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadWaitNoResume 132 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadGetName 133 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadSelfName 134 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadGetType 135 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserSignal 136 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserReset 137 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserWait 138 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserWaitNoResume 343 139 %endif 344 .not_found: 345 %ifdef DEBUG 346 int3 347 %endif 348 jmp .epilog 349 ENDPROC NtWrapLocateMarkerHelper 350 351 352 353 ; 354 ; This has the same order as the list in SUPDrv.c 355 ; 356 NtWrapFunctionWithAllRegParams SUPR0ComponentRegisterFactory 357 NtWrapFunctionWithAllRegParams SUPR0ComponentDeregisterFactory 358 NtWrapFunctionWithAllRegParams SUPR0ComponentQueryFactory 359 NtWrapFunctionWith5Params SUPR0ObjRegister 360 NtWrapFunctionWithAllRegParams SUPR0ObjAddRef 361 NtWrapFunctionWithAllRegParams SUPR0ObjRelease 362 NtWrapFunctionWithAllRegParams SUPR0ObjVerifyAccess 363 NtWrapFunctionWithAllRegParams SUPR0LockMem 364 NtWrapFunctionWithAllRegParams SUPR0UnlockMem 365 NtWrapFunctionWith5Params SUPR0ContAlloc 366 NtWrapFunctionWithAllRegParams SUPR0ContFree 367 NtWrapFunctionWith5Params SUPR0LowAlloc 368 NtWrapFunctionWithAllRegParams SUPR0LowFree 369 NtWrapFunctionWithAllRegParams SUPR0MemAlloc 370 NtWrapFunctionWithAllRegParams SUPR0MemGetPhys 371 NtWrapFunctionWithAllRegParams SUPR0MemFree 372 NtWrapFunctionWithAllRegParams SUPR0PageAlloc 373 NtWrapFunctionWithAllRegParams SUPR0PageFree 374 ;NtWrapFunctionWithAllRegParams SUPR0Printf - cannot wrap this buster. 375 NtWrapFunctionWithAllRegParams RTMemAlloc 376 NtWrapFunctionWithAllRegParams RTMemAllocZ 377 NtWrapFunctionWithAllRegParams RTMemFree 378 NtWrapFunctionWithAllRegParams RTMemDup 379 NtWrapFunctionWithAllRegParams RTMemDupEx 380 NtWrapFunctionWithAllRegParams RTMemRealloc 381 NtWrapFunctionWithAllRegParams RTR0MemObjAllocLow 382 NtWrapFunctionWithAllRegParams RTR0MemObjAllocPage 383 NtWrapFunctionWithAllRegParams RTR0MemObjAllocPhys 384 NtWrapFunctionWithAllRegParams RTR0MemObjAllocPhysNC 385 NtWrapFunctionWithAllRegParams RTR0MemObjAllocCont 386 NtWrapFunctionWithAllRegParams RTR0MemObjLockUser 387 NtWrapFunctionWith5Params RTR0MemObjMapKernel 388 NtWrapFunctionWith6Params RTR0MemObjMapUser 389 ;NtWrapFunctionWithAllRegParams RTR0MemObjAddress - not necessary 390 ;NtWrapFunctionWithAllRegParams RTR0MemObjAddressR3 - not necessary 391 ;NtWrapFunctionWithAllRegParams RTR0MemObjSize - not necessary 392 ;NtWrapFunctionWithAllRegParams RTR0MemObjIsMapping - not necessary 393 ;NtWrapFunctionWithAllRegParams RTR0MemObjGetPagePhysAddr - not necessary 394 NtWrapFunctionWithAllRegParams RTR0MemObjFree 395 ;NtWrapFunctionWithAllRegParams RTProcSelf - not necessary 396 ;NtWrapFunctionWithAllRegParams RTR0ProcHandleSelf - not necessary 397 NtWrapFunctionWithAllRegParams RTSemFastMutexCreate 398 NtWrapFunctionWithAllRegParams RTSemFastMutexDestroy 399 NtWrapFunctionWithAllRegParams RTSemFastMutexRequest 400 NtWrapFunctionWithAllRegParams RTSemFastMutexRelease 401 NtWrapFunctionWithAllRegParams RTSemEventCreate 402 NtWrapFunctionWithAllRegParams RTSemEventSignal 403 NtWrapFunctionWithAllRegParams RTSemEventWait 404 NtWrapFunctionWithAllRegParams RTSemEventWaitNoResume 405 NtWrapFunctionWithAllRegParams RTSemEventDestroy 406 NtWrapFunctionWithAllRegParams RTSemEventMultiCreate 407 NtWrapFunctionWithAllRegParams RTSemEventMultiSignal 408 NtWrapFunctionWithAllRegParams RTSemEventMultiReset 409 NtWrapFunctionWithAllRegParams RTSemEventMultiWait 410 NtWrapFunctionWithAllRegParams RTSemEventMultiWaitNoResume 411 NtWrapFunctionWithAllRegParams RTSemEventMultiDestroy 412 NtWrapFunctionWithAllRegParams RTSpinlockCreate 413 NtWrapFunctionWithAllRegParams RTSpinlockDestroy 414 NtWrapFunctionWithAllRegParams RTSpinlockAcquire 415 NtWrapFunctionWithAllRegParams RTSpinlockRelease 416 NtWrapFunctionWithAllRegParams RTSpinlockAcquireNoInts 417 NtWrapFunctionWithAllRegParams RTSpinlockReleaseNoInts 418 ;NtWrapFunctionWithAllRegParams RTTimeNanoTS - not necessary 419 ;NtWrapFunctionWithAllRegParams RTTimeMilliTS - not necessary 420 ;NtWrapFunctionWithAllRegParams RTTimeSystemNanoTS - not necessary 421 ;NtWrapFunctionWithAllRegParams RTTimeSystemMilliTS - not necessary 422 ;NtWrapFunctionWithAllRegParams RTThreadNativeSelf - not necessary 423 NtWrapFunctionWithAllRegParams RTThreadSleep 424 NtWrapFunctionWithAllRegParams RTThreadYield 425 %if 0 ; Thread APIs, Part 2 426 ;NtWrapFunctionWithAllRegParams RTThreadSelf 427 NtWrapFunctionWith7Params RTThreadCreate 428 NtWrapFunctionWithAllRegParams RTThreadGetNative 429 NtWrapFunctionWithAllRegParams RTThreadWait 430 NtWrapFunctionWithAllRegParams RTThreadWaitNoResume 431 NtWrapFunctionWithAllRegParams RTThreadGetName 432 NtWrapFunctionWithAllRegParams RTThreadSelfName 433 NtWrapFunctionWithAllRegParams RTThreadGetType 434 NtWrapFunctionWithAllRegParams RTThreadUserSignal 435 NtWrapFunctionWithAllRegParams RTThreadUserReset 436 NtWrapFunctionWithAllRegParams RTThreadUserWait 437 NtWrapFunctionWithAllRegParams RTThreadUserWaitNoResume 438 %endif 439 ;NtWrapFunctionWithAllRegParams RTLogDefaultInstance - a bit of a gamble, but we do not want the overhead! 440 ;NtWrapFunctionWithAllRegParams RTMpCpuId - not necessary 441 ;NtWrapFunctionWithAllRegParams RTMpCpuIdFromSetIndex - not necessary 442 ;NtWrapFunctionWithAllRegParams RTMpCpuIdToSetIndex - not necessary 443 ;NtWrapFunctionWithAllRegParams RTMpIsCpuPossible - not necessary 444 ;NtWrapFunctionWithAllRegParams RTMpGetCount - not necessary 445 ;NtWrapFunctionWithAllRegParams RTMpGetMaxCpuId - not necessary 446 ;NtWrapFunctionWithAllRegParams RTMpGetOnlineCount - not necessary 447 ;NtWrapFunctionWithAllRegParams RTMpGetOnlineSet - not necessary 448 ;NtWrapFunctionWithAllRegParams RTMpGetSet - not necessary 449 ;NtWrapFunctionWithAllRegParams RTMpIsCpuOnline - not necessary 450 NtWrapFunctionWithAllRegParams RTMpOnAll 451 NtWrapFunctionWithAllRegParams RTMpOnOthers 452 NtWrapFunctionWithAllRegParams RTMpOnSpecific 453 ;NtWrapFunctionWithAllRegParams RTLogRelDefaultInstance - not necessary. 454 NtWrapFunctionWithAllRegParams RTLogSetDefaultInstanceThread 455 ;NtWrapFunctionWithAllRegParams RTLogLogger - can't wrap this buster. 456 ;NtWrapFunctionWithAllRegParams RTLogLoggerEx - can't wrap this buster. 457 NtWrapFunctionWith5Params RTLogLoggerExV 458 ;NtWrapFunctionWithAllRegParams RTLogPrintf - can't wrap this buster. ;; @todo provide va_list log wrappers in RuntimeR0. 459 NtWrapFunctionWithAllRegParams RTLogPrintfV 460 NtWrapFunctionWithAllRegParams AssertMsg1 461 ;NtWrapFunctionWithAllRegParams AssertMsg2 - can't wrap this buster. 140 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogDefaultInstance - a bit of a gamble, but we do not want the overhead! 141 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpCpuId - not necessary 142 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpCpuIdFromSetIndex - not necessary 143 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpCpuIdToSetIndex - not necessary 144 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpIsCpuPossible - not necessary 145 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetCount - not necessary 146 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetMaxCpuId - not necessary 147 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetOnlineCount - not necessary 148 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetOnlineSet - not necessary 149 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetSet - not necessary 150 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpIsCpuOnline - not necessary 151 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpOnAll 152 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpOnOthers 153 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpOnSpecific 154 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogRelDefaultInstance - not necessary. 155 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogSetDefaultInstanceThread 156 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogLogger - can't wrap this buster. 157 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogLoggerEx - can't wrap this buster. 158 NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, RTLogLoggerExV 159 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogPrintf - can't wrap this buster. ;; @todo provide va_list log wrappers in RuntimeR0. 160 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogPrintfV 161 NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, AssertMsg1 162 ;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, AssertMsg2 - can't wrap this buster. 462 163 463 164 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk
r12974 r13421 37 37 VBoxNetFlt_LDFLAGS.win.x86 = -Entry:DriverEntry@8 38 38 VBoxNetFlt_LDFLAGS.win.amd64 = -Entry:DriverEntry 39 VBoxNetFlt_SOURCES.win.amd64 += win/VBoxNetFltA-win.asm 40 VBoxNetFlt_DEFS.win.amd64 += SUPDRV_WITH_UNWIND_HACK 39 41 VBoxNetFlt_LIBS.win = \ 40 42 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \ -
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c
r12653 r13421 374 374 } 375 375 376 #ifdef SUPDRV_WITH_UNWIND_HACK 377 # if defined(RT_OS_WINDOWS) && defined(RT_ARCH_AMD64) 378 # define NETFLT_DECL_CALLBACK(type) DECLASM(DECLHIDDEN(type)) 379 # define NETFLT_CALLBACK(_n) netfltNtWrap##_n 380 381 NETFLT_DECL_CALLBACK(int) NETFLT_CALLBACK(vboxNetFltPortXmit)(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG, uint32_t fDst); 382 NETFLT_DECL_CALLBACK(bool) NETFLT_CALLBACK(vboxNetFltPortIsPromiscuous)(PINTNETTRUNKIFPORT pIfPort); 383 NETFLT_DECL_CALLBACK(void) NETFLT_CALLBACK(vboxNetFltPortGetMacAddress)(PINTNETTRUNKIFPORT pIfPort, PRTMAC pMac); 384 NETFLT_DECL_CALLBACK(bool) NETFLT_CALLBACK(vboxNetFltPortIsHostMac)(PINTNETTRUNKIFPORT pIfPort, PCRTMAC pMac); 385 NETFLT_DECL_CALLBACK(int) NETFLT_CALLBACK(vboxNetFltPortWaitForIdle)(PINTNETTRUNKIFPORT pIfPort, uint32_t cMillies); 386 NETFLT_DECL_CALLBACK(bool) NETFLT_CALLBACK(vboxNetFltPortSetActive)(PINTNETTRUNKIFPORT pIfPort, bool fActive); 387 NETFLT_DECL_CALLBACK(void) NETFLT_CALLBACK(vboxNetFltPortDisconnectAndRelease)(PINTNETTRUNKIFPORT pIfPort); 388 NETFLT_DECL_CALLBACK(void) NETFLT_CALLBACK(vboxNetFltPortRetain)(PINTNETTRUNKIFPORT pIfPort); 389 NETFLT_DECL_CALLBACK(void) NETFLT_CALLBACK(vboxNetFltPortRelease)(PINTNETTRUNKIFPORT pIfPort); 390 391 # else 392 # error "UNSUPPORTED (SUPDRV_WITH_UNWIND_HACK)" 393 # endif 394 #else 395 # define NETFLT_DECL_CALLBACK(type) static DECLCALLBACK(type) 396 # define NETFLT_CALLBACK(_n) _n 397 #endif 376 398 377 399 /** 378 400 * @copydoc INTNETTRUNKIFPORT::pfnXmit 379 401 */ 380 static DECLCALLBACK(int) vboxNetFltPortXmit(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG, uint32_t fDst)402 NETFLT_DECL_CALLBACK(int) vboxNetFltPortXmit(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG, uint32_t fDst) 381 403 { 382 404 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); … … 409 431 * @copydoc INTNETTRUNKIFPORT::pfnIsPromiscuous 410 432 */ 411 static DECLCALLBACK(bool) vboxNetFltPortIsPromiscuous(PINTNETTRUNKIFPORT pIfPort)433 NETFLT_DECL_CALLBACK(bool) vboxNetFltPortIsPromiscuous(PINTNETTRUNKIFPORT pIfPort) 412 434 { 413 435 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); … … 431 453 * @copydoc INTNETTRUNKIFPORT::pfnGetMacAddress 432 454 */ 433 static DECLCALLBACK(void) vboxNetFltPortGetMacAddress(PINTNETTRUNKIFPORT pIfPort, PRTMAC pMac)455 NETFLT_DECL_CALLBACK(void) vboxNetFltPortGetMacAddress(PINTNETTRUNKIFPORT pIfPort, PRTMAC pMac) 434 456 { 435 457 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); … … 453 475 * @copydoc INTNETTRUNKIFPORT::pfnIsHostMac 454 476 */ 455 static DECLCALLBACK(bool) vboxNetFltPortIsHostMac(PINTNETTRUNKIFPORT pIfPort, PCRTMAC pMac)477 NETFLT_DECL_CALLBACK(bool) vboxNetFltPortIsHostMac(PINTNETTRUNKIFPORT pIfPort, PCRTMAC pMac) 456 478 { 457 479 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); … … 475 497 * @copydoc INTNETTRUNKIFPORT::pfnWaitForIdle 476 498 */ 477 static DECLCALLBACK(int) vboxNetFltPortWaitForIdle(PINTNETTRUNKIFPORT pIfPort, uint32_t cMillies)499 NETFLT_DECL_CALLBACK(int) vboxNetFltPortWaitForIdle(PINTNETTRUNKIFPORT pIfPort, uint32_t cMillies) 478 500 { 479 501 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); … … 506 528 * @copydoc INTNETTRUNKIFPORT::pfnSetActive 507 529 */ 508 static DECLCALLBACK(bool) vboxNetFltPortSetActive(PINTNETTRUNKIFPORT pIfPort, bool fActive)530 NETFLT_DECL_CALLBACK(bool) vboxNetFltPortSetActive(PINTNETTRUNKIFPORT pIfPort, bool fActive) 509 531 { 510 532 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); … … 541 563 * @copydoc INTNETTRUNKIFPORT::pfnDisconnectAndRelease 542 564 */ 543 static DECLCALLBACK(void) vboxNetFltPortDisconnectAndRelease(PINTNETTRUNKIFPORT pIfPort)565 NETFLT_DECL_CALLBACK(void) vboxNetFltPortDisconnectAndRelease(PINTNETTRUNKIFPORT pIfPort) 544 566 { 545 567 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); … … 684 706 * @copydoc INTNETTRUNKIFPORT::pfnRetain 685 707 */ 686 static DECLCALLBACK(void) vboxNetFltPortRelease(PINTNETTRUNKIFPORT pIfPort)708 NETFLT_DECL_CALLBACK(void) vboxNetFltPortRelease(PINTNETTRUNKIFPORT pIfPort) 687 709 { 688 710 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); … … 736 758 * @copydoc INTNETTRUNKIFPORT::pfnRetain 737 759 */ 738 static DECLCALLBACK(void) vboxNetFltPortRetain(PINTNETTRUNKIFPORT pIfPort)760 NETFLT_DECL_CALLBACK(void) vboxNetFltPortRetain(PINTNETTRUNKIFPORT pIfPort) 739 761 { 740 762 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); … … 814 836 pNew->pNext = NULL; 815 837 pNew->MyPort.u32Version = INTNETTRUNKIFPORT_VERSION; 816 pNew->MyPort.pfnRetain = vboxNetFltPortRetain;817 pNew->MyPort.pfnRelease = vboxNetFltPortRelease;818 pNew->MyPort.pfnDisconnectAndRelease= vboxNetFltPortDisconnectAndRelease;819 pNew->MyPort.pfnSetActive = vboxNetFltPortSetActive;820 pNew->MyPort.pfnWaitForIdle = vboxNetFltPortWaitForIdle;821 pNew->MyPort.pfnGetMacAddress = vboxNetFltPortGetMacAddress;822 pNew->MyPort.pfnIsHostMac = vboxNetFltPortIsHostMac;823 pNew->MyPort.pfnIsPromiscuous = vboxNetFltPortIsPromiscuous;824 pNew->MyPort.pfnXmit = vboxNetFltPortXmit;838 pNew->MyPort.pfnRetain = NETFLT_CALLBACK(vboxNetFltPortRetain); 839 pNew->MyPort.pfnRelease = NETFLT_CALLBACK(vboxNetFltPortRelease); 840 pNew->MyPort.pfnDisconnectAndRelease= NETFLT_CALLBACK(vboxNetFltPortDisconnectAndRelease); 841 pNew->MyPort.pfnSetActive = NETFLT_CALLBACK(vboxNetFltPortSetActive); 842 pNew->MyPort.pfnWaitForIdle = NETFLT_CALLBACK(vboxNetFltPortWaitForIdle); 843 pNew->MyPort.pfnGetMacAddress = NETFLT_CALLBACK(vboxNetFltPortGetMacAddress); 844 pNew->MyPort.pfnIsHostMac = NETFLT_CALLBACK(vboxNetFltPortIsHostMac); 845 pNew->MyPort.pfnIsPromiscuous = NETFLT_CALLBACK(vboxNetFltPortIsPromiscuous); 846 pNew->MyPort.pfnXmit = NETFLT_CALLBACK(vboxNetFltPortXmit); 825 847 pNew->MyPort.u32VersionEnd = INTNETTRUNKIFPORT_VERSION; 826 848 pNew->pSwitchPort = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.