D
Dirk Schulze
Hello,
please have a look at the fallowing code:
/* NetWkstaGetInfo - WKSTA_INFO_100
typedef struct WKSTA_INFO_100
{
DWORD wki100_platform_id;
LPWSTR wki100_computername;
LPWSTR wki100_langroup;
DWORD wki100_ver_major;
DWORD wki100_ver_minor;
}*/
[StructLayout(LayoutKind.Sequential)]
struct WKSTA_INFO_100
{
public int id;
[MarshalAs(UnmanagedType.LPWStr)]
public string computername;
[MarshalAs(UnmanagedType.LPWStr)]
public string langroup;
public int ver_major;
public int ver_minor;
}
or
[StructLayout(LayoutKind.Sequential)]
struct WKSTA_INFO_100
{
public int id;
public string computernme;
public string langroup;
public int ver_major;
public int ver_minor;
}
or
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
struct WKSTA_INFO_100
{
public int id;
public string computernme;
public string langroup;
public int ver_major;
public int ver_minor;
}
I do not really understand the difference between these 3 structures
of WKSTA_INFO_100
Are they all correct because they all seems to work??
Which one should be used and can anybody explain me the exact
difference between them?
Please, put the light on ))
Many thanks,
Dirk
please have a look at the fallowing code:
/* NetWkstaGetInfo - WKSTA_INFO_100
typedef struct WKSTA_INFO_100
{
DWORD wki100_platform_id;
LPWSTR wki100_computername;
LPWSTR wki100_langroup;
DWORD wki100_ver_major;
DWORD wki100_ver_minor;
}*/
[StructLayout(LayoutKind.Sequential)]
struct WKSTA_INFO_100
{
public int id;
[MarshalAs(UnmanagedType.LPWStr)]
public string computername;
[MarshalAs(UnmanagedType.LPWStr)]
public string langroup;
public int ver_major;
public int ver_minor;
}
or
[StructLayout(LayoutKind.Sequential)]
struct WKSTA_INFO_100
{
public int id;
public string computernme;
public string langroup;
public int ver_major;
public int ver_minor;
}
or
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
struct WKSTA_INFO_100
{
public int id;
public string computernme;
public string langroup;
public int ver_major;
public int ver_minor;
}
I do not really understand the difference between these 3 structures
of WKSTA_INFO_100
Are they all correct because they all seems to work??
Which one should be used and can anybody explain me the exact
difference between them?
Please, put the light on ))
Many thanks,
Dirk