Community Forums
Results 1 to 5 of 5

Thread: lc_hostid returns save value with 2 different physical hard disks

  1. #1
    ndphuong Guest

    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.

  2. #2
    Join Date
    Mar 2018
    Posts
    28

    Interesting output. Can shed some light on few details?

    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

  3. #3
    Join Date
    Mar 2018
    Posts
    28

    Is it related to your another query about BootRoom setup?

    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

  4. #4
    ndphuong Guest
    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;
    }


    Quote Originally Posted by Aparashar View Post
    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
    Attached Images Attached Images     

  5. #5
    ndphuong Guest
    Quote Originally Posted by Aparashar View Post
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •