in reply to Use Windows wimgapi dll

If you add
print $fh;
You'll get something resembling FileHandle=GLOB(0x1990c80) not C:\data.wim as you probably wanted.