Changed a variable maybe? Locked a surface which should be locked? (oh wait.. that's ddraw )

Your best bet is on checking each variable that you are using with the function and check if it is what it supposed to be..

my 1 and half euro cents