Hex value for GENERIC_READ or GENERIC_WRITE

  • Thread starter Thread starter Mario
  • Start date Start date
M

Mario

Hi,

To access a peripheral I need to provide AccessCode and ShareMode. The
values for AccessMode, per MSDN docs, are 0, GENERIC_READ, and
GENERIC_WRITE. For ShareMode, they are FILE_SHARE_READ and
FILE_SHARE_WRITE. If I want to read and write I would need to OR the
values. However, VS2005 does not recognize them as defined values. I
was thinking if I can find the Hex values for them then I can just pass
the hex values in the function call. If someone could tell me what
these values are or where can I find them is appreciated. Thanks.

Cheers,

Mario
 
You'd find them in a C/C++ SDK for the target device or at least for a
device like it. Since you're using VS2005, the header files for the target
device and C/C++ should be there (<x>:\program files\Microsoft Visual Studio
8\SmartDevices\SDK. Search for files like *.h containing those strings and,
no, don't just use hex values. That makes your code very annoying to read.

Paul T.
 
Thanks Paul. I did find the hex values. However, I found them under
PocketPC2003 and SmartPhone2003. Does that mean that I am missing the
SDK for WinCE? My project is on WinCE. Thanks.

Cheers,

Mario
 
No, that's fine. The values don't change from one version to another. I'm
sure that you won't find the C/C++ SDK for your Windows CE device in that
folder. If you figure out where you installed it, probably \program
files\windows ce tools\wce500\<platform name>, you'll find the same values
there.

Paul T.
 
Thanks. This is really helpful.

Cheers,

Mario

No, that's fine. The values don't change from one version to another. I'm
sure that you won't find the C/C++ SDK for your Windows CE device in that
folder. If you figure out where you installed it, probably \program
files\windows ce tools\wce500\<platform name>, you'll find the same values
there.

Paul T.
 
Back
Top