VirtualBox

Ignore:
Timestamp:
Jul 6, 2010 2:26:53 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63427
Message:

Generate a session id for the VM that is changed every time the VM starts, resets or is restored.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp

    r28800 r30668  
    7575}
    7676
     77/**
     78 * Query the session id of this VM; this is a unique id that gets changed for each VM start, reset or restore.
     79 * Useful for detection a VM restore.
     80 *
     81 * @returns IPRT status code.
     82 * pu64IdSession    Session id (out)
     83 *
     84 */
     85VBGLR3DECL(int) VbglR3GetSessionId(uint64_t *pu64IdSession)
     86{
     87    VMMDevReqSessionId Req;
     88
     89    vmmdevInitRequest(&Req.header, VMMDevReq_GetSessionId);
     90    int rc = vbglR3GRPerform(&Req.header);
     91    if (rc == VINF_SUCCESS)
     92        *pu64IdSession = Req.idSession;
     93
     94    return rc;
     95}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette