# Visual Basic > Visual Basic 6 and Earlier >  [RESOLVED] Trying to make "_allshl" work in ntdll.dll

## Elroy

Ok, I've successfully made "_allmul" work (also in ntdll.dll).  It appears to use the *stdcall* calling convention.

If possible, I'd also like to get "_allshl" working.  Documentation is sparse, but it appears to use the *cdecl* calling convention, so I (today) downloaded and installed The Trick's Add-In.

With this Add-In running, I've got the following code (just in Form1):



```

Option Explicit
Private Declare Function Int64ShiftL CDecl Lib "ntdll" Alias "_allshl" (ByVal cBase As Currency, ByVal cBitsToShift As Currency) As Currency

Private Sub Form_Load()
    Dim c1 As Currency
    c1 = CCur(&H1010101)
    Dim c2 As Currency
    c2 = 0.0001@
    Dim c3 As Currency
    c3 = Int64ShiftL(c1, c2)
    Debug.Print c3

    Unload Me
End Sub


```

I've tried it with several numbers, but it always returns ZERO in the return.

Anybody know what I'm doing wrong?

If I delete the CDecl from the API declaration, I get a "Bad DLL Calling Convention" runtime error.

I'm at a loss.

----------


## Elroy

Resolved.  I found the RtlLargeIntegerShiftLeft, RtlLargeIntegerShiftRight, & RtlLargeIntegerArithmeticShift within NTDLL, and they work perfectly and are using the StdCall calling convention.

----------


## fafalone

The problem isn't the CDecl calling convention... I tried it in twinbasic which supports cdecl properly out of the box and it doesn't work there either regardless of how I tried to call it.

----------


## Elroy

> The problem isn't the CDecl calling convention... I tried it in twinbasic which supports cdecl properly out of the box and it doesn't work there either regardless of how I tried to call it.


Thanks for testing Fafalone.  I switched over to the RtlLargeIntegerShiftLeft, RtlLargeIntegerShiftRight, & RtlLargeIntegerArithmeticShift, and they all work perfectly.  So, I just abandoned the _allshl call.

----------


## The trick

```
;
; llshl - long shift left
;
; Purpose:
;       Does a Long Shift Left (signed and unsigned are identical)
;       Shifts a long left any number of bits.
;
; Entry:
;       EDX:EAX - long value to be shifted
;       CL      - number of bits to shift by
;
; Exit:
;       EDX:EAX - shifted value
;
; Uses:
;       CL is destroyed.
;
```

----------


## Elroy

Ahhh, and I figured out why none of this worked.

Apparently _allshl uses a *borland fastcall* convention.

Here's a page that references it.

----------

