Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am calling tDeviceProperty structure from My C# code. I tryed lot of options but still not working. Can any one help me in marshalling this code in C#.

Thanks in advance.

typedef struct _FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
} FILETIME, *PFILETIME, *LPFILETIME;

#define _FILETIME_

#if defined(MIDL_PASS)

typedef struct _LARGE_INTEGER {

#else

typedef union _LARGE_INTEGER {

    struct {
        DWORD LowPart;
        LONG HighPart;
    };

    struct {
        DWORD LowPart;
        LONG HighPart;
    } u;

#endif

    LONGLONG QuadPart;

} LARGE_INTEGER;



typedef LARGE_INTEGER *PLARGE_INTEGER;



struct tDeviceProperty {
      DWORD Tag;
      DWORD Size;
      union _DP value;
};



typedef union _DP

{
      short int           i;
      LONG                l;
      ULONG               ul;
      float               flt;
      double              dbl;
      BOOL        b;
      double              at;
      FILETIME            ft;
      LPSTR               lpszA;
      LPWSTR              lpszW;
      LARGE_INTEGER       li;
      struct tBinary    bin;
      BYTE                reserved[40];
} __UDP;



struct tBinary {
      ULONG size;
      BYTE * bin;
};
Posted
Updated 19-May-10 5:52am
v2

1 solution

It would be helpful for us if you share what you did earlier. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900