From: Pavel A. on
So , this is the purpose of the HCT calling convention test?
Check that exceptions will work properly?

--PA


"Maxim S. Shatskih" wrote:
> > of AMD64, that is radically different, and that requires the
> > compiler/assembler
> > to properly describe the code regions
>
> IIRC "gcc" uses the same on x86 for C++ exceptions. This results in eliminating
> nearly any extra machine code use to enter and leave the exception frames.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim(a)storagecraft.com
> http://www.storagecraft.com
>
>
>
From: Ivan Brugiolo [MSFT] on
Essentially, yes.
To make sure that an exception can cross the driver's code
without bug-checking the machine.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Pavel A." <pavel_a(a)NOwritemeNO.com> wrote in message
news:A4BC21D3-77AD-4E18-A117-61A3B6E05EB0(a)microsoft.com...
> So , this is the purpose of the HCT calling convention test?
> Check that exceptions will work properly?
>
> --PA
>
>
> "Maxim S. Shatskih" wrote:
>> > of AMD64, that is radically different, and that requires the
>> > compiler/assembler
>> > to properly describe the code regions
>>
>> IIRC "gcc" uses the same on x86 for C++ exceptions. This results in
>> eliminating
>> nearly any extra machine code use to enter and leave the exception
>> frames.
>>
>> --
>> Maxim Shatskih, Windows DDK MVP
>> StorageCraft Corporation
>> maxim(a)storagecraft.com
>> http://www.storagecraft.com
>>
>>
>>


From: Tonald on
The error is like this:
" <Assert File="e:\amd64\test.asm" Line="28" UserText="Error 103: The stack
must always be 16-byte aligned when a call instruction is executed.
Misaligned stack with relative depth FFFFFF08 at instruction: @ call Do_FIR"
CA="3418789856" LA="3419016946">"

The function code attached below:
What My finding is that, the test treat the stack position where call Do_FIR
is a negative position. If i let the stack position be add rsp,28h, the test
will have no such error, but of course, add rsp is fatal error.




..DATA
ADDR1 QWORD 0
ADDR2 QWORD 0
ADDR3 QWORD 0
ADDR4 QWORD 0
..CODE
PUBLIC TEST
PUBLIC Do_FIR

TEST proc FRAME

sub rsp 98h
.allocstack 98h
.endprolog



...
....
.....
mov r9,ADD4
mov r8,ADD3
mov rdx,ADD2
mov rcx,ADD1

mov QWORD PTR [rsp+18h],r9
mov QWORD PTR [rsp+10h],r8
mov QWORD PTR [rsp+8h],rdx
mov QWORD PTR [rsp],rcx

call Do_FIR


...
....
.....

add rsp,98h
ret
TEST endp

END



"Ivan Brugiolo [MSFT]" wrote:

> Essentially, yes.
> To make sure that an exception can cross the driver's code
> without bug-checking the machine.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
>
> "Pavel A." <pavel_a(a)NOwritemeNO.com> wrote in message
> news:A4BC21D3-77AD-4E18-A117-61A3B6E05EB0(a)microsoft.com...
> > So , this is the purpose of the HCT calling convention test?
> > Check that exceptions will work properly?
> >
> > --PA
> >
> >
> > "Maxim S. Shatskih" wrote:
> >> > of AMD64, that is radically different, and that requires the
> >> > compiler/assembler
> >> > to properly describe the code regions
> >>
> >> IIRC "gcc" uses the same on x86 for C++ exceptions. This results in
> >> eliminating
> >> nearly any extra machine code use to enter and leave the exception
> >> frames.
> >>
> >> --
> >> Maxim Shatskih, Windows DDK MVP
> >> StorageCraft Corporation
> >> maxim(a)storagecraft.com
> >> http://www.storagecraft.com
> >>
> >>
> >>
>
>
>
From: Ivan Brugiolo [MSFT] on
I have replicated the problem,
and the owner of abiprov.exe will try to address the issue in the tool.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Tonald" <Tonald(a)discussions.microsoft.com> wrote in message
news:67849938-58D8-42EC-9BEF-7A5EB7945CE1(a)microsoft.com...
> The error is like this:
> " <Assert File="e:\amd64\test.asm" Line="28" UserText="Error 103: The
> stack
> must always be 16-byte aligned when a call instruction is executed.
> Misaligned stack with relative depth FFFFFF08 at instruction: @ call
> Do_FIR"
> CA="3418789856" LA="3419016946">"
>
> The function code attached below:
> What My finding is that, the test treat the stack position where call
> Do_FIR
> is a negative position. If i let the stack position be add rsp,28h, the
> test
> will have no such error, but of course, add rsp is fatal error.
>
>
>
>
> .DATA
> ADDR1 QWORD 0
> ADDR2 QWORD 0
> ADDR3 QWORD 0
> ADDR4 QWORD 0
> .CODE
> PUBLIC TEST
> PUBLIC Do_FIR
>
> TEST proc FRAME
>
> sub rsp 98h
> .allocstack 98h
> .endprolog
>
>
>
> ...
> ....
> .....
> mov r9,ADD4
> mov r8,ADD3
> mov rdx,ADD2
> mov rcx,ADD1
>
> mov QWORD PTR [rsp+18h],r9
> mov QWORD PTR [rsp+10h],r8
> mov QWORD PTR [rsp+8h],rdx
> mov QWORD PTR [rsp],rcx
>
> call Do_FIR
>
>
> ...
> ....
> .....
>
> add rsp,98h
> ret
> TEST endp
>
> END
>
>
>
> "Ivan Brugiolo [MSFT]" wrote:
>
>> Essentially, yes.
>> To make sure that an exception can cross the driver's code
>> without bug-checking the machine.
>>
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> Use of any included script samples are subject to the terms specified at
>> http://www.microsoft.com/info/cpyright.htm
>>
>>
>> "Pavel A." <pavel_a(a)NOwritemeNO.com> wrote in message
>> news:A4BC21D3-77AD-4E18-A117-61A3B6E05EB0(a)microsoft.com...
>> > So , this is the purpose of the HCT calling convention test?
>> > Check that exceptions will work properly?
>> >
>> > --PA
>> >
>> >
>> > "Maxim S. Shatskih" wrote:
>> >> > of AMD64, that is radically different, and that requires the
>> >> > compiler/assembler
>> >> > to properly describe the code regions
>> >>
>> >> IIRC "gcc" uses the same on x86 for C++ exceptions. This results in
>> >> eliminating
>> >> nearly any extra machine code use to enter and leave the exception
>> >> frames.
>> >>
>> >> --
>> >> Maxim Shatskih, Windows DDK MVP
>> >> StorageCraft Corporation
>> >> maxim(a)storagecraft.com
>> >> http://www.storagecraft.com
>> >>
>> >>
>> >>
>>
>>
>>