After screwing around for a few hours, I finally found out what was causing the problem with my program, and I thought I'd document it here in case it comes up for someone else.
The GetObject api fails if the BITMAP memory does not start on an even word boundary.
.data?
align 4
hBmp dd ?
tstbyte db ?
btmap BITMAP <> ; misaligned bitmap
.code
.
.
.
inv GetObject,hBmp,sizeof btmap,addr btmap
Works fine if I align btmap, otherwise it just returns a zero, and GetLastError returns "Error code 0, the operation completed successfully".