cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ndphuong
Level 3

lc_hostid returns save value with 2 different physical hard disks

We have a problem with get hostid in our clients. We are using HostidDiskSernum as lc_hostid Parameter, our client has 2 PCs with 2 different physical hard disks but lc_hostId function return the same value. We don’t know why it happened.
Before we used HostidDefault but we got many problems if the user’s hardware is changed so we changed to HostidDiskSernum parameter.
0 Kudos
(5) Replies
Aparashar
Flexera Alumni

HI,

Since the API lc_hosid provided with argument as "DISK_SERIAL_NUM" has been conventionally providing me with the (VSN) or say hard disk serial number. So, it would be interesting to know the environment in which you can observe this error.
What's the FNP API version? Also what's the environment (OS, VM/physical), if possible can you share the snippet of code ran which provides the similar outputs on 2 different systems?

Regards,
Abhay
0 Kudos
Aparashar
Flexera Alumni

Hi ndphuong,

just noticed another query from you regarding "bootroom" setup. Where we don't have an actual hard disk on clients. Are you observing the reported behavior in same setup?

Regards,
Abhay
0 Kudos
ndphuong
Level 3

Hi Abhay,

Thanks for your response.

We are using FNP 11.6. Both computers are running a 64-bit version of Windows 7, physical not VM, not BootRoom system.

The hostid is 200879 for 2 different physical hard disks (attached files)
Below is the code we are using:
private XmlResult GenerateMachineId()
{
var result = new XmlResult();
try
{
if (!Initialized || !JobCreated) Initialize();

IntPtr machineId = Marshal.AllocHGlobal(4096);

var returnEnum = (ResultEnum)Features.lc_hostid
(
_jobHandle,
FlexConstants.HostidDiskSernum,
machineId
);

result.success = returnEnum.Equals(ResultEnum.Success);

if (!result.success)
{
result.foreignData = GetForeignData(returnEnum);
}
else
{
var xmlData = new StringBuilder("");
foreach (string mId in Marshal.PtrToStringAnsi(machineId).Split(' '))
xmlData.Append("" + mId.Replace("\"", "") + "");
xmlData.Append("
");
var xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlData.ToString());
result.result = xmlDoc;
}
}
catch (Exception ex)
{
result.success = false;
result.error = -1;
result.errorMessage = ex.Message;
}
return result;
}


Aparashar wrote:
HI,

Since the API lc_hosid provided with argument as "DISK_SERIAL_NUM" has been conventionally providing me with the (VSN) or say hard disk serial number. So, it would be interesting to know the environment in which you can observe this error.
What's the FNP API version? Also what's the environment (OS, VM/physical), if possible can you share the snippet of code ran which provides the similar outputs on 2 different systems?

Regards,
Abhay
0 Kudos
ndphuong
Level 3

Aparashar wrote:
HI,

Since the API lc_hosid provided with argument as "DISK_SERIAL_NUM" has been conventionally providing me with the (VSN) or say hard disk serial number. So, it would be interesting to know the environment in which you can observe this error.
What's the FNP API version? Also what's the environment (OS, VM/physical), if possible can you share the snippet of code ran which provides the similar outputs on 2 different systems?

Regards,
Abhay


Did you read my response?
0 Kudos
Aparashar
Flexera Alumni

there seems more to the issue here. Probably a formal support ticket would be the best way to get Flexera Engineering people involved.

Regards,
Abhay
0 Kudos