1

I am a scsi driver developer.

I write a user space program to get data from driver via CreateFile.

It works ok when testing in 32 bit windows environment but in 64 bit the following error appears:

CreateFile return -1. GetLastError() would return 2. (ERROR_FILE_NOT_FOUND)

I have called IoCreateSymbolicLink when driver initializes and it returns success when I am using windbg to see debug output.

Anyone has met this kind of problem?

PowerStat
  • 3,757
  • 8
  • 32
  • 57
  • When you say `CreateFile` returns -2, what do you mean? `CreateFile` returns a `HANDLE` value or `INVALID_HANDLE_VALUE`, which is actually -1. Were you instead referring to what `GetLastError()` returns after the `CreateFile` call? Also, `ERROR_FILE_NOT_FOUND` is 2, not -2. – reuben Feb 20 '12 at 06:35
  • sorry, i mean CreateFile returns a HANDLE -1. then i using GetLastError() i got 2 - ERROR_FILE_NOT_FOUND. – user1220367 Feb 20 '12 at 06:40
  • Are you sure your driver loaded correctly on the 64-bit system? That might explain why your user-space code couldn't find it. – reuben Feb 20 '12 at 06:42
  • yes, i am sure driver loaded correctly. it is a SCSI driver, PCI HBA card simulate as a Harddisk and already install windows 7 drivers – user1220367 Feb 20 '12 at 06:50
  • Can you see the device / symlink using a tool like WinObj (http://technet.microsoft.com/en-us/sysinternals/bb896657)? This sounds rather odd... – reuben Feb 20 '12 at 06:52
  • i can get from WinObj and QuickView (http://www.opferman.com/Software/QuickView/). Name Type SymLink JQBTScsi SymbolicLink \Device\Scsi\JQT51821 but still can't CreateFile – user1220367 Feb 20 '12 at 09:45

0 Answers0