Hello jangogrande
This is how you should use the function, most examples here are pure crap.
.386
.model Flat, STDCALL
option Casemap :None
TRUE equ 1
includelib \masm32\lib\ntdll.lib
RtlCompareString PROTO STDCALL :ptr,:ptr,:BYTE
includelib \masm32\lib\msvcrt.lib
printf PROTO C :ptr, :vararg
_STRING struct
_Length word ?
_Maximumlength word ?
_Buffer dword ?
_STRING ends
.data
s1 db "abcd" ;
s2 db "bab"
format db 'result: %d',13,10,0
.code
main proc
LOCAL str1 : _STRING
LOCAL str2 : _STRING
mov str1._Length, LENGTHOF s1
mov str1._Maximumlength, LENGTHOF s1
mov eax, offset s1
mov str1._Buffer, eax
mov str2._Length, LENGTHOF s2
mov str2._Maximumlength, LENGTHOF s2
mov eax, offset s2
mov str2._Buffer, eax
INVOKE RtlCompareString, addr str1, addr str2, TRUE
INVOKE printf, addr format, eax ; should display negative
ret
main endp
end main
Beware also that the prototype of RtlCompareString is wrong in the NtDll.inc include file.