PDA

View Full Version : lc_hostid returns save value with 2 different physical hard disks



ndphuong
04-18-2018, 01:59 AM
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.

Aparashar
04-19-2018, 01:12 AM
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

Aparashar
04-19-2018, 01:14 AM
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

ndphuong
04-24-2018, 09:44 PM
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("<hostIds>");
foreach (string mId in Marshal.PtrToStringAnsi(machineId).Split(' '))
xmlData.Append("<hostId>" + mId.Replace("\"", "") + "</hostId>");
xmlData.Append("</hostIds>");
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;
}



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

ndphuong
05-03-2018, 04:08 AM
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?

Aparashar
09-14-2018, 01:04 AM
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