From: John Wolfe Date: Thu, 4 Feb 2021 17:57:03 +0000 (-0800) Subject: Drop usage of vmware_pack_*.h header files. X-Git-Tag: stable-11.3.0~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d114fa0a5c050d1e84d6e73a9942d2e82aa8f00;p=thirdparty%2Fopen-vm-tools.git Drop usage of vmware_pack_*.h header files. Both gcc and clang support the Microsoft-style "pragma pack" syntax. --- diff --git a/open-vm-tools/lib/include/guestInfo.h b/open-vm-tools/lib/include/guestInfo.h index a09520bea..0107b7f3c 100644 --- a/open-vm-tools/lib/include/guestInfo.h +++ b/open-vm-tools/lib/include/guestInfo.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2003-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -94,15 +94,13 @@ typedef struct GuestNicInfoV1 { NicEntryV1 nicList[MAX_NICS]; } GuestNicInfoV1; -typedef -#include "vmware_pack_begin.h" -struct _PartitionEntry { +#pragma pack(push, 1) +typedef struct _PartitionEntry { uint64 freeBytes; uint64 totalBytes; char name[PARTITION_NAME_SIZE]; -} -#include "vmware_pack_end.h" -PartitionEntry, *PPartitionEntry; +} PartitionEntry, *PPartitionEntry; +#pragma pack(pop) typedef struct _DiskInfo { unsigned int numEntries; diff --git a/open-vm-tools/lib/include/guestStats.h b/open-vm-tools/lib/include/guestStats.h index a52df0c6a..351623b82 100644 --- a/open-vm-tools/lib/include/guestStats.h +++ b/open-vm-tools/lib/include/guestStats.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2018,2020 VMware, Inc. All rights reserved. + * Copyright (C) 2008-2018,2020-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -82,18 +82,16 @@ * It should stay the same to ensure binary compatibility. */ -typedef -#include "vmware_pack_begin.h" -struct GuestMemInfoLegacy { +#pragma pack(push, 1) +typedef struct GuestMemInfoLegacy { uint32 version; ///< MemInfo structure version. uint32 flags; ///< Indicates which stats are valid. uint64 memTotal; ///< Total physical memory in Kb. uint64 deprecated1[9]; ///< No longer used. uint64 hugePagesTotal; ///< Total number of huge pages. uint64 deprecated2[2]; ///< No longer used. -} -#include "vmware_pack_end.h" -GuestMemInfoLegacy; +} GuestMemInfoLegacy; +#pragma pack(pop) /* * A stat begins with a header. The header has a mask which says what data @@ -113,26 +111,22 @@ typedef enum { GUEST_DATUM_VALUE = 0x0080, // value data } GuestDatum; -typedef -#include "vmware_pack_begin.h" -struct GuestStatHeader { +#pragma pack(push, 1) +typedef struct GuestStatHeader { GuestDatum datumFlags; // Indicates how many and which data follow -} -#include "vmware_pack_end.h" -GuestStatHeader; +} GuestStatHeader; +#pragma pack(pop) #ifdef _MSC_VER #pragma warning (disable :4200) // non-std extension: zero-sized array in struct #endif -typedef -#include "vmware_pack_begin.h" -struct GuestDatumHeader { +#pragma pack(push, 1) +typedef struct GuestDatumHeader { uint16 dataSize; // dataSize - May be zero char data[0]; // data - if dataSize is not zero. -} -#include "vmware_pack_end.h" -GuestDatumHeader; +} GuestDatumHeader; +#pragma pack(pop) /* * Units datum enum. diff --git a/open-vm-tools/lib/include/hgfsProto.h b/open-vm-tools/lib/include/hgfsProto.h index 60d05fa67..3fa3d45a9 100644 --- a/open-vm-tools/lib/include/hgfsProto.h +++ b/open-vm-tools/lib/include/hgfsProto.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2020 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -364,9 +364,8 @@ typedef uint64 HgfsRenameHint; * Version 2 should be using HgfsAttrV2. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsAttr { +#pragma pack(push, 1) +typedef struct HgfsAttr { HgfsFileType type; /* File type */ uint64 size; /* File size (in bytes) */ uint64 creationTime; /* Creation time. Ignored by POSIX */ @@ -375,9 +374,8 @@ struct HgfsAttr { uint64 attrChangeTime; /* Time file attributess were last * changed. Ignored by Windows */ HgfsPermissions permissions; /* Permissions bits */ -} -#include "vmware_pack_end.h" -HgfsAttr; +} HgfsAttr; +#pragma pack(pop) /* Various flags and Windows attributes. */ @@ -499,9 +497,8 @@ typedef uint64 HgfsCreateDirValid; * Version 2 of HgfsAttr */ -typedef -#include "vmware_pack_begin.h" -struct HgfsAttrV2 { +#pragma pack(push, 1) +typedef struct HgfsAttrV2 { HgfsAttrValid mask; /* A bit mask to determine valid attribute fields */ HgfsFileType type; /* File type */ uint64 size; /* File size (in bytes) */ @@ -525,9 +522,8 @@ struct HgfsAttrV2 { uint32 volumeId; /* volume identifier, non-zero is valid. */ uint32 effectivePerms; /* Permissions in effect for the user on the host. */ uint64 reserved2; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsAttrV2; +} HgfsAttrV2; +#pragma pack(pop) /* @@ -596,28 +592,24 @@ HgfsAttrV2; * See UAX 15 (http://unicode.org/reports/tr15/) */ -typedef -#include "vmware_pack_begin.h" -struct HgfsFileName { +#pragma pack(push, 1) +typedef struct HgfsFileName { uint32 length; /* Does NOT include terminating NUL */ char name[1]; -} -#include "vmware_pack_end.h" -HgfsFileName; +} HgfsFileName; +#pragma pack(pop) /* * Windows hosts only: the server may return the DOS 8 dot 3 format * name as part of the directory entry. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsShortFileName { +#pragma pack(push, 1) +typedef struct HgfsShortFileName { uint32 length; /* Does NOT include terminating NUL */ char name[12 * 4]; /* UTF8 max char size is 4 bytes. */ -} -#include "vmware_pack_end.h" -HgfsShortFileName; +} HgfsShortFileName; +#pragma pack(pop) /* * Case-sensitiviy flags are only used when any lookup is @@ -636,17 +628,15 @@ typedef enum { * Hgfs file handle. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsFileNameV3 { +#pragma pack(push, 1) +typedef struct HgfsFileNameV3 { uint32 length; /* Does NOT include terminating NUL */ uint32 flags; /* Flags described below. */ HgfsCaseType caseType; /* Case-sensitivity type. */ HgfsHandle fid; char name[1]; -} -#include "vmware_pack_end.h" -HgfsFileNameV3; +} HgfsFileNameV3; +#pragma pack(pop) /* @@ -661,24 +651,20 @@ HgfsFileNameV3; * operation request and reply messages, respectively. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequest { +#pragma pack(push, 1) +typedef struct HgfsRequest { HgfsHandle id; /* Opaque request ID used by the requestor */ HgfsOp op; -} -#include "vmware_pack_end.h" -HgfsRequest; +} HgfsRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReply { +#pragma pack(push, 1) +typedef struct HgfsReply { HgfsHandle id; /* Opaque request ID used by the requestor */ HgfsStatus status; -} -#include "vmware_pack_end.h" -HgfsReply; +} HgfsReply; +#pragma pack(pop) /* @@ -687,24 +673,21 @@ HgfsReply; /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestOpen { +#pragma pack(push, 1) +typedef struct HgfsRequestOpen { HgfsRequest header; HgfsOpenMode mode; /* Which type of access is requested */ HgfsOpenFlags flags; /* Which flags to open the file with */ HgfsPermissions permissions; /* Which permissions to *create* a new file with */ HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestOpen; +} HgfsRequestOpen; +#pragma pack(pop) /* Version 2 of HgfsRequestOpen */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestOpenV2 { +#pragma pack(push, 1) +typedef struct HgfsRequestOpenV2 { HgfsRequest header; HgfsOpenValid mask; /* Bitmask that specified which fields are valid. */ HgfsOpenMode mode; /* Which type of access requested. See desiredAccess */ @@ -721,16 +704,14 @@ struct HgfsRequestOpenV2 { uint64 reserved1; /* Reserved for future use */ uint64 reserved2; /* Reserved for future use */ HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestOpenV2; +} HgfsRequestOpenV2; +#pragma pack(pop) /* Version 3 of HgfsRequestOpen */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestOpenV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestOpenV3 { HgfsOpenValid mask; /* Bitmask that specified which fields are valid. */ HgfsOpenMode mode; /* Which type of access requested. See desiredAccess */ HgfsOpenFlags flags; /* Which flags to open the file with */ @@ -746,34 +727,29 @@ struct HgfsRequestOpenV3 { uint64 reserved1; /* Reserved for future use */ uint64 reserved2; /* Reserved for future use */ HgfsFileNameV3 fileName; -} -#include "vmware_pack_end.h" -HgfsRequestOpenV3; +} HgfsRequestOpenV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyOpen { +#pragma pack(push, 1) +typedef struct HgfsReplyOpen { HgfsReply header; HgfsHandle file; /* Opaque file ID used by the server */ -} -#include "vmware_pack_end.h" -HgfsReplyOpen; +} HgfsReplyOpen; +#pragma pack(pop) /* Version 2 of HgfsReplyOpen */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyOpenV2 { +#pragma pack(push, 1) +typedef struct HgfsReplyOpenV2 { HgfsReply header; HgfsHandle file; /* Opaque file ID used by the server */ HgfsLockType acquiredLock; /* The type of lock acquired by the server */ -} -#include "vmware_pack_end.h" -HgfsReplyOpenV2; +} HgfsReplyOpenV2; +#pragma pack(pop) /* Version 3 of HgfsReplyOpen */ @@ -790,42 +766,36 @@ typedef uint32 HgfsReplyOpenFlags; #define HGFS_OPEN_REPLY_ALLOC_DISK_SPACE (1 << 0) #define HGFS_OPEN_REPLY_LOCKED_FILE (1 << 1) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyOpenV3 { +#pragma pack(push, 1) +typedef struct HgfsReplyOpenV3 { HgfsHandle file; /* Opaque file ID used by the server */ HgfsLockType acquiredLock; /* The type of lock acquired by the server */ HgfsReplyOpenFlags flags; /* Opened file flags */ uint32 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplyOpenV3; +} HgfsReplyOpenV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestRead { +#pragma pack(push, 1) +typedef struct HgfsRequestRead { HgfsRequest header; HgfsHandle file; /* Opaque file ID used by the server */ uint64 offset; uint32 requiredSize; -} -#include "vmware_pack_end.h" -HgfsRequestRead; +} HgfsRequestRead; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyRead { +#pragma pack(push, 1) +typedef struct HgfsReplyRead { HgfsReply header; uint32 actualSize; char payload[1]; -} -#include "vmware_pack_end.h" -HgfsReplyRead; +} HgfsReplyRead; +#pragma pack(pop) /* @@ -833,82 +803,70 @@ HgfsReplyRead; * Server must support HGFS_LARGE_PACKET_MAX to implement this op. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestReadV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestReadV3 { HgfsHandle file; /* Opaque file ID used by the server */ uint64 offset; uint32 requiredSize; uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsRequestReadV3; +} HgfsRequestReadV3; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyReadV3 { +#pragma pack(push, 1) +typedef struct HgfsReplyReadV3 { uint32 actualSize; uint64 reserved; /* Reserved for future use */ char payload[1]; -} -#include "vmware_pack_end.h" -HgfsReplyReadV3; +} HgfsReplyReadV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestWrite { +#pragma pack(push, 1) +typedef struct HgfsRequestWrite { HgfsRequest header; HgfsHandle file; /* Opaque file ID used by the server */ HgfsWriteFlags flags; uint64 offset; uint32 requiredSize; char payload[1]; -} -#include "vmware_pack_end.h" -HgfsRequestWrite; +} HgfsRequestWrite; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyWrite { +#pragma pack(push, 1) +typedef struct HgfsReplyWrite { HgfsReply header; uint32 actualSize; -} -#include "vmware_pack_end.h" -HgfsReplyWrite; +} HgfsReplyWrite; +#pragma pack(pop) /* * Version 3 of HgfsRequestWrite. * Server must support HGFS_LARGE_PACKET_MAX to implement this op. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestWriteV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestWriteV3 { HgfsHandle file; /* Opaque file ID used by the server */ HgfsWriteFlags flags; uint64 offset; uint32 requiredSize; uint64 reserved; /* Reserved for future use */ char payload[1]; -} -#include "vmware_pack_end.h" -HgfsRequestWriteV3; +} HgfsRequestWriteV3; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyWriteV3 { +#pragma pack(push, 1) +typedef struct HgfsReplyWriteV3 { uint32 actualSize; uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplyWriteV3; +} HgfsReplyWriteV3; +#pragma pack(pop) /* Stream write flags */ typedef enum { @@ -920,172 +878,143 @@ typedef enum { * Server must support HGFS_LARGE_PACKET_MAX to implement this op. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestWriteWin32StreamV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestWriteWin32StreamV3 { HgfsHandle file; /* Opaque file ID used by the server */ HgfsWin32StreamFlags flags; uint32 reserved1; uint32 requiredSize; uint64 reserved2; /* Reserved for future use */ char payload[1]; -} -#include "vmware_pack_end.h" -HgfsRequestWriteWin32StreamV3; +} HgfsRequestWriteWin32StreamV3; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyWriteWin32StreamV3 { +#pragma pack(push, 1) +typedef struct HgfsReplyWriteWin32StreamV3 { uint32 actualSize; uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplyWriteWin32StreamV3; +} HgfsReplyWriteWin32StreamV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestClose { +#pragma pack(push, 1) +typedef struct HgfsRequestClose { HgfsRequest header; HgfsHandle file; /* Opaque file ID used by the server */ -} -#include "vmware_pack_end.h" -HgfsRequestClose; +} HgfsRequestClose; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyClose { +#pragma pack(push, 1) +typedef struct HgfsReplyClose { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplyClose; +} HgfsReplyClose; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestCloseV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestCloseV3 { HgfsHandle file; /* Opaque file ID used by the server */ uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsRequestCloseV3; +} HgfsRequestCloseV3; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyCloseV3 { +#pragma pack(push, 1) +typedef struct HgfsReplyCloseV3 { uint64 reserved; -} -#include "vmware_pack_end.h" -HgfsReplyCloseV3; +} HgfsReplyCloseV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSearchOpen { +#pragma pack(push, 1) +typedef struct HgfsRequestSearchOpen { HgfsRequest header; HgfsFileName dirName; -} -#include "vmware_pack_end.h" -HgfsRequestSearchOpen; +} HgfsRequestSearchOpen; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSearchOpenV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestSearchOpenV3 { uint64 reserved; /* Reserved for future use */ HgfsFileNameV3 dirName; -} -#include "vmware_pack_end.h" -HgfsRequestSearchOpenV3; +} HgfsRequestSearchOpenV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySearchOpen { +#pragma pack(push, 1) +typedef struct HgfsReplySearchOpen { HgfsReply header; HgfsHandle search; /* Opaque search ID used by the server */ -} -#include "vmware_pack_end.h" -HgfsReplySearchOpen; +} HgfsReplySearchOpen; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySearchOpenV3 { +#pragma pack(push, 1) +typedef struct HgfsReplySearchOpenV3 { HgfsHandle search; /* Opaque search ID used by the server */ uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplySearchOpenV3; +} HgfsReplySearchOpenV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSearchRead { +#pragma pack(push, 1) +typedef struct HgfsRequestSearchRead { HgfsRequest header; HgfsHandle search; /* Opaque search ID used by the server */ uint32 offset; /* The first result is offset 0 */ -} -#include "vmware_pack_end.h" -HgfsRequestSearchRead; +} HgfsRequestSearchRead; +#pragma pack(pop) /* Version 2 of HgfsRequestSearchRead */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSearchReadV2 { +#pragma pack(push, 1) +typedef struct HgfsRequestSearchReadV2 { HgfsRequest header; HgfsHandle search; /* Opaque search ID used by the server */ uint32 offset; /* The first result is offset 0 */ -} -#include "vmware_pack_end.h" -HgfsRequestSearchReadV2; +} HgfsRequestSearchReadV2; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSearchReadV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestSearchReadV3 { HgfsHandle search; /* Opaque search ID used by the server */ uint32 offset; /* The first result is offset 0 */ uint32 flags; /* Reserved for reading multiple directory entries. */ uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsRequestSearchReadV3; +} HgfsRequestSearchReadV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySearchRead { +#pragma pack(push, 1) +typedef struct HgfsReplySearchRead { HgfsReply header; HgfsAttr attr; HgfsFileName fileName; /* fileName.length = 0 means "no entry at this offset" */ -} -#include "vmware_pack_end.h" -HgfsReplySearchRead; +} HgfsReplySearchRead; +#pragma pack(pop) /* Version 2 of HgfsReplySearchRead */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySearchReadV2 { +#pragma pack(push, 1) +typedef struct HgfsReplySearchReadV2 { HgfsReply header; HgfsAttrV2 attr; @@ -1095,9 +1024,8 @@ struct HgfsReplySearchReadV2 { * this name is the name of the symlink, not the target. */ HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsReplySearchReadV2; +} HgfsReplySearchReadV2; +#pragma pack(pop) /* Directory entry structure. */ @@ -1114,113 +1042,94 @@ typedef struct HgfsDirEntry { HgfsFileNameV3 fileName; } HgfsDirEntry; -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySearchReadV3 { +#pragma pack(push, 1) +typedef struct HgfsReplySearchReadV3 { uint64 count; /* Number of directory entries. */ uint64 reserved; /* Reserved for future use. */ char payload[1]; /* Directory entries. */ -} -#include "vmware_pack_end.h" -HgfsReplySearchReadV3; +} HgfsReplySearchReadV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSearchClose { +#pragma pack(push, 1) +typedef struct HgfsRequestSearchClose { HgfsRequest header; HgfsHandle search; /* Opaque search ID used by the server */ -} -#include "vmware_pack_end.h" -HgfsRequestSearchClose; +} HgfsRequestSearchClose; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySearchClose { +#pragma pack(push, 1) +typedef struct HgfsReplySearchClose { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplySearchClose; +} HgfsReplySearchClose; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSearchCloseV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestSearchCloseV3 { HgfsHandle search; /* Opaque search ID used by the server */ uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsRequestSearchCloseV3; +} HgfsRequestSearchCloseV3; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySearchCloseV3 { +#pragma pack(push, 1) +typedef struct HgfsReplySearchCloseV3 { uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplySearchCloseV3; +} HgfsReplySearchCloseV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestGetattr { +#pragma pack(push, 1) +typedef struct HgfsRequestGetattr { HgfsRequest header; HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestGetattr; +} HgfsRequestGetattr; +#pragma pack(pop) /* Version 2 of HgfsRequestGetattr */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestGetattrV2 { +#pragma pack(push, 1) +typedef struct HgfsRequestGetattrV2 { HgfsRequest header; HgfsAttrHint hints; /* Flags for file handle valid. */ HgfsHandle file; /* Opaque file ID used by the server. */ HgfsFileName fileName; /* Filename used when file handle invalid. */ -} -#include "vmware_pack_end.h" -HgfsRequestGetattrV2; +} HgfsRequestGetattrV2; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestGetattrV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestGetattrV3 { HgfsAttrHint hints; /* Flags for file handle valid. */ uint64 reserved; /* Reserved for future use */ HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ -} -#include "vmware_pack_end.h" -HgfsRequestGetattrV3; +} HgfsRequestGetattrV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyGetattr { +#pragma pack(push, 1) +typedef struct HgfsReplyGetattr { HgfsReply header; HgfsAttr attr; -} -#include "vmware_pack_end.h" -HgfsReplyGetattr; +} HgfsReplyGetattr; +#pragma pack(pop) /* Version 2 of HgfsReplyGetattr */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyGetattrV2 { +#pragma pack(push, 1) +typedef struct HgfsReplyGetattrV2 { HgfsReply header; HgfsAttrV2 attr; @@ -1232,14 +1141,12 @@ struct HgfsReplyGetattrV2 { * This filename is in "CPNameLite" format. See CPNameLite.c for details. */ HgfsFileName symlinkTarget; -} -#include "vmware_pack_end.h" -HgfsReplyGetattrV2; +} HgfsReplyGetattrV2; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyGetattrV3 { +#pragma pack(push, 1) +typedef struct HgfsReplyGetattrV3 { HgfsAttrV2 attr; /* @@ -1251,99 +1158,83 @@ struct HgfsReplyGetattrV3 { */ uint64 reserved; /* Reserved for future use */ HgfsFileNameV3 symlinkTarget; -} -#include "vmware_pack_end.h" -HgfsReplyGetattrV3; +} HgfsReplyGetattrV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSetattr { +#pragma pack(push, 1) +typedef struct HgfsRequestSetattr { HgfsRequest header; HgfsAttrChanges update; /* Which fields need to be updated */ HgfsAttr attr; HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestSetattr; +} HgfsRequestSetattr; +#pragma pack(pop) /* Version 2 of HgfsRequestSetattr */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSetattrV2 { +#pragma pack(push, 1) +typedef struct HgfsRequestSetattrV2 { HgfsRequest header; HgfsAttrHint hints; HgfsAttrV2 attr; HgfsHandle file; /* Opaque file ID used by the server. */ HgfsFileName fileName; /* Filename used when file handle invalid. */ -} -#include "vmware_pack_end.h" -HgfsRequestSetattrV2; +} HgfsRequestSetattrV2; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSetattrV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestSetattrV3 { HgfsAttrHint hints; HgfsAttrV2 attr; uint64 reserved; /* Reserved for future use */ HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ -} -#include "vmware_pack_end.h" -HgfsRequestSetattrV3; +} HgfsRequestSetattrV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySetattr { +#pragma pack(push, 1) +typedef struct HgfsReplySetattr { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplySetattr; +} HgfsReplySetattr; +#pragma pack(pop) /* Version 2 of HgfsReplySetattr */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySetattrV2 { +#pragma pack(push, 1) +typedef struct HgfsReplySetattrV2 { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplySetattrV2; +} HgfsReplySetattrV2; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySetattrV3 { +#pragma pack(push, 1) +typedef struct HgfsReplySetattrV3 { uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplySetattrV3; +} HgfsReplySetattrV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestCreateDir { +#pragma pack(push, 1) +typedef struct HgfsRequestCreateDir { HgfsRequest header; HgfsPermissions permissions; HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestCreateDir; +} HgfsRequestCreateDir; +#pragma pack(pop) /* Version 2 of HgfsRequestCreateDir */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestCreateDirV2 { +#pragma pack(push, 1) +typedef struct HgfsRequestCreateDirV2 { HgfsRequest header; HgfsCreateDirValid mask; HgfsPermissions specialPerms; @@ -1351,16 +1242,14 @@ struct HgfsRequestCreateDirV2 { HgfsPermissions groupPerms; HgfsPermissions otherPerms; HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestCreateDirV2; +} HgfsRequestCreateDirV2; +#pragma pack(pop) /* Version 3 of HgfsRequestCreateDir */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestCreateDirV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestCreateDirV3 { HgfsCreateDirValid mask; HgfsPermissions specialPerms; HgfsPermissions ownerPerms; @@ -1368,113 +1257,94 @@ struct HgfsRequestCreateDirV3 { HgfsPermissions otherPerms; HgfsAttrFlags fileAttr; HgfsFileNameV3 fileName; -} -#include "vmware_pack_end.h" -HgfsRequestCreateDirV3; +} HgfsRequestCreateDirV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyCreateDir { +#pragma pack(push, 1) +typedef struct HgfsReplyCreateDir { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplyCreateDir; +} HgfsReplyCreateDir; +#pragma pack(pop) /* Version 2 of HgfsReplyCreateDir */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyCreateDirV2 { +#pragma pack(push, 1) +typedef struct HgfsReplyCreateDirV2 { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplyCreateDirV2; +} HgfsReplyCreateDirV2; +#pragma pack(pop) /* Version 3 of HgfsReplyCreateDir */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyCreateDirV3 { +#pragma pack(push, 1) +typedef struct HgfsReplyCreateDirV3 { uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplyCreateDirV3; +} HgfsReplyCreateDirV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestDelete { +#pragma pack(push, 1) +typedef struct HgfsRequestDelete { HgfsRequest header; HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestDelete; +} HgfsRequestDelete; +#pragma pack(pop) /* Version 2 of HgfsRequestDelete */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestDeleteV2 { +#pragma pack(push, 1) +typedef struct HgfsRequestDeleteV2 { HgfsRequest header; HgfsDeleteHint hints; HgfsHandle file; /* Opaque file ID used by the server. */ HgfsFileName fileName; /* Name used if the file is HGFS_HANDLE_INVALID */ -} -#include "vmware_pack_end.h" -HgfsRequestDeleteV2; +} HgfsRequestDeleteV2; +#pragma pack(pop) /* Version 3 of HgfsRequestDelete */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestDeleteV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestDeleteV3 { HgfsDeleteHint hints; uint64 reserved; /* Reserved for future use */ HgfsFileNameV3 fileName; /* Name used if the file is HGFS_HANDLE_INVALID */ -} -#include "vmware_pack_end.h" -HgfsRequestDeleteV3; +} HgfsRequestDeleteV3; +#pragma pack(pop) /* Deprecated */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyDelete { +#pragma pack(push, 1) +typedef struct HgfsReplyDelete { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplyDelete; +} HgfsReplyDelete; +#pragma pack(pop) /* Version 2 of HgfsReplyDelete */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyDeleteV2 { +#pragma pack(push, 1) +typedef struct HgfsReplyDeleteV2 { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplyDeleteV2; +} HgfsReplyDeleteV2; +#pragma pack(pop) /* Version 2 of HgfsReplyDelete */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyDeleteV3 { +#pragma pack(push, 1) +typedef struct HgfsReplyDeleteV3 { uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplyDeleteV3; +} HgfsReplyDeleteV3; +#pragma pack(pop) /* @@ -1487,184 +1357,152 @@ HgfsReplyDeleteV3; * &oldName + sizeof(HgfsFileName) + oldName.length */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestRename { +#pragma pack(push, 1) +typedef struct HgfsRequestRename { HgfsRequest header; HgfsFileName oldName; HgfsFileName newName; -} -#include "vmware_pack_end.h" -HgfsRequestRename; +} HgfsRequestRename; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyRename { +#pragma pack(push, 1) +typedef struct HgfsReplyRename { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplyRename; +} HgfsReplyRename; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestRenameV2 { +#pragma pack(push, 1) +typedef struct HgfsRequestRenameV2 { HgfsRequest header; HgfsRenameHint hints; HgfsHandle srcFile; /* Opaque file ID to "old name" used by the server. */ HgfsHandle targetFile; /* Opaque file ID to "old name" used by the server. */ HgfsFileName oldName; HgfsFileName newName; -} -#include "vmware_pack_end.h" -HgfsRequestRenameV2; +} HgfsRequestRenameV2; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyRenameV2 { +#pragma pack(push, 1) +typedef struct HgfsReplyRenameV2 { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplyRenameV2; +} HgfsReplyRenameV2; +#pragma pack(pop) /* HgfsRequestRename and HgfsReplyRename for v3. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestRenameV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestRenameV3 { HgfsRenameHint hints; uint64 reserved; /* Reserved for future use */ HgfsFileNameV3 oldName; HgfsFileNameV3 newName; -} -#include "vmware_pack_end.h" -HgfsRequestRenameV3; +} HgfsRequestRenameV3; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyRenameV3 { +#pragma pack(push, 1) +typedef struct HgfsReplyRenameV3 { uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplyRenameV3; +} HgfsReplyRenameV3; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestQueryVolume { +#pragma pack(push, 1) +typedef struct HgfsRequestQueryVolume { HgfsRequest header; HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestQueryVolume; +} HgfsRequestQueryVolume; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyQueryVolume { +#pragma pack(push, 1) +typedef struct HgfsReplyQueryVolume { HgfsReply header; uint64 freeBytes; uint64 totalBytes; -} -#include "vmware_pack_end.h" -HgfsReplyQueryVolume; +} HgfsReplyQueryVolume; +#pragma pack(pop) /* HgfsRequestQueryVolume and HgfsReplyQueryVolume for v3. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestQueryVolumeV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestQueryVolumeV3 { uint64 reserved; /* Reserved for future use */ HgfsFileNameV3 fileName; -} -#include "vmware_pack_end.h" -HgfsRequestQueryVolumeV3; +} HgfsRequestQueryVolumeV3; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyQueryVolumeV3 { +#pragma pack(push, 1) +typedef struct HgfsReplyQueryVolumeV3 { uint64 freeBytes; uint64 totalBytes; uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplyQueryVolumeV3; +} HgfsReplyQueryVolumeV3; +#pragma pack(pop) /* New operations for Version 2 */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestServerLockChange { +#pragma pack(push, 1) +typedef struct HgfsRequestServerLockChange { HgfsRequest header; HgfsHandle file; HgfsLockType newServerLock; -} -#include "vmware_pack_end.h" -HgfsRequestServerLockChange; +} HgfsRequestServerLockChange; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyServerLockChange { +#pragma pack(push, 1) +typedef struct HgfsReplyServerLockChange { HgfsReply header; HgfsLockType serverLock; -} -#include "vmware_pack_end.h" -HgfsReplyServerLockChange; +} HgfsReplyServerLockChange; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSymlinkCreate { +#pragma pack(push, 1) +typedef struct HgfsRequestSymlinkCreate { HgfsRequest header; HgfsFileName symlinkName; /* This filename is in "CPNameLite" format. See CPNameLite.c for details. */ HgfsFileName targetName; -} -#include "vmware_pack_end.h" -HgfsRequestSymlinkCreate; +} HgfsRequestSymlinkCreate; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySymlinkCreate { +#pragma pack(push, 1) +typedef struct HgfsReplySymlinkCreate { HgfsReply header; -} -#include "vmware_pack_end.h" -HgfsReplySymlinkCreate; +} HgfsReplySymlinkCreate; +#pragma pack(pop) /* HgfsRequestSymlinkCreate and HgfsReplySymlinkCreate for v3. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSymlinkCreateV3 { +#pragma pack(push, 1) +typedef struct HgfsRequestSymlinkCreateV3 { uint64 reserved; /* Reserved for future use */ HgfsFileNameV3 symlinkName; /* This filename is in "CPNameLite" format. See CPNameLite.c for details. */ HgfsFileNameV3 targetName; -} -#include "vmware_pack_end.h" -HgfsRequestSymlinkCreateV3; +} HgfsRequestSymlinkCreateV3; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySymlinkCreateV3 { +#pragma pack(push, 1) +typedef struct HgfsReplySymlinkCreateV3 { uint64 reserved; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsReplySymlinkCreateV3; +} HgfsReplySymlinkCreateV3; +#pragma pack(pop) /* HGFS protocol version 4 definitions. */ #define HGFS_HEADER_VERSION_1 1 @@ -1680,9 +1518,8 @@ HgfsReplySymlinkCreateV3; #define HGFS_PACKET_FLAG_INFO_EXTERROR (1 << 2) // Info has ext error #define HGFS_PACKET_FLAG_VALID_FLAGS (0x7) // Mask for valid values -typedef -#include "vmware_pack_begin.h" -struct HgfsHeader { +#pragma pack(push, 1) +typedef struct HgfsHeader { uint8 version; /* Header version. */ uint8 reserved1[3]; /* Reserved for future use. */ HgfsOp dummy; /* Needed to distinguish between older and newer header. */ @@ -1695,9 +1532,8 @@ struct HgfsHeader { uint32 information; /* Generic field, used e.g. for native error code. */ uint64 sessionId; /* Session ID. */ uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsHeader; +} HgfsHeader; +#pragma pack(pop) typedef uint32 HgfsOpCapFlags; @@ -1798,30 +1634,26 @@ typedef uint32 HgfsOpCapFlags; #define HGFS_OP_CAPFLAG_SET_WATCH_FINE_GRAIN_EVENTS (1 << 16) -typedef -#include "vmware_pack_begin.h" -struct HgfsOpCapability { +#pragma pack(push, 1) +typedef struct HgfsOpCapability { HgfsOp op; /* Op. */ HgfsOpCapFlags flags; /* Flags. */ -} -#include "vmware_pack_end.h" -HgfsOpCapability; +} HgfsOpCapability; +#pragma pack(pop) typedef HgfsFileName HgfsUserName; typedef HgfsFileName HgfsGroupName; /* Following structures describe user identity on the host which runs HGFS service. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsIdentity { +#pragma pack(push, 1) +typedef struct HgfsIdentity { uint32 uid; /* user id. */ uint32 gid; /* Primary group id. */ HgfsUserName user; /* User name in form specified in RFC 3530. */ HgfsGroupName group; /* Group name in form specified in RFC 3530. */ -} -#include "vmware_pack_end.h" -HgfsIdentity; +} HgfsIdentity; +#pragma pack(pop) #define HGFS_INVALID_SESSION_ID (~((uint64)0)) @@ -1838,21 +1670,18 @@ typedef uint32 HgfsSessionFlags; #define HGFS_SESSION_OPLOCK_ENABLED (1 << 2) #define HGFS_SESSION_ASYNC_IO_ENABLED (1 << 3) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestCreateSessionV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestCreateSessionV4 { uint32 numCapabilities; /* Number of capabilities to follow. */ uint32 maxPacketSize; /* Maximum packet size supported. */ HgfsSessionFlags flags; /* Session capability flags. */ uint32 reserved; /* Reserved for future use. */ HgfsOpCapability capabilities[1]; /* Array of HgfsCapabilities. */ -} -#include "vmware_pack_end.h" -HgfsRequestCreateSessionV4; +} HgfsRequestCreateSessionV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyCreateSessionV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyCreateSessionV4 { uint64 sessionId; /* Session ID. */ uint32 numCapabilities; /* Number of capabilities to follow. */ uint32 maxPacketSize; /* Maximum packet size supported. */ @@ -1860,25 +1689,20 @@ struct HgfsReplyCreateSessionV4 { HgfsSessionFlags flags; /* Flags. */ uint32 reserved; /* Reserved for future use. */ HgfsOpCapability capabilities[1]; /* Array of HgfsCapabilities. */ -} -#include "vmware_pack_end.h" -HgfsReplyCreateSessionV4; +} HgfsReplyCreateSessionV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestDestroySessionV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestDestroySessionV4 { uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsRequestDestroySessionV4; +} HgfsRequestDestroySessionV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyDestroySessionV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyDestroySessionV4 { uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsReplyDestroySessionV4; +} HgfsReplyDestroySessionV4; +#pragma pack(pop) /* Adds new error status: HGFS_STATUS_INVALID_SESSION. */ @@ -1886,16 +1710,14 @@ HgfsReplyDestroySessionV4; * If file handle is used to set watch (HGFS_FILE_NAME_USE_FILE_DESC * is set in the fileName), closing this handle implicitly removes the watch. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSetWatchV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestSetWatchV4 { uint64 events; /* What events to watch? */ uint32 flags; /* Flags. */ uint64 reserved; /* Reserved for future use. */ HgfsFileNameV3 fileName; /* Filename to watch. */ -} -#include "vmware_pack_end.h" -HgfsRequestSetWatchV4; +} HgfsRequestSetWatchV4; +#pragma pack(pop) /* * Coarse grain notification event types. @@ -1954,41 +1776,33 @@ HgfsRequestSetWatchV4; typedef uint64 HgfsSubscriberHandle; #define HGFS_INVALID_SUBSCRIBER_HANDLE ((HgfsSubscriberHandle)~((HgfsSubscriberHandle)0)) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySetWatchV4 { +#pragma pack(push, 1) +typedef struct HgfsReplySetWatchV4 { HgfsSubscriberHandle watchId; /* Watch identifier for subsequent references. */ uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsReplySetWatchV4; +} HgfsReplySetWatchV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestRemoveWatchV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestRemoveWatchV4 { HgfsSubscriberHandle watchId; /* Watch identifier to remove. */ -} -#include "vmware_pack_end.h" -HgfsRequestRemoveWatchV4; +} HgfsRequestRemoveWatchV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyRemoveWatchV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyRemoveWatchV4 { uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsReplyRemoveWatchV4; +} HgfsReplyRemoveWatchV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsNotifyEventV4 { +#pragma pack(push, 1) +typedef struct HgfsNotifyEventV4 { uint32 nextOffset; /* Offset of next event; 0 if it i sthe last one. */ uint64 mask; /* Event occurred. */ uint64 reserved; /* Reserved for future use. */ HgfsFileName fileName; /* Filename. */ -} -#include "vmware_pack_end.h" -HgfsNotifyEventV4; +} HgfsNotifyEventV4; +#pragma pack(pop) /* Too many events, some or all event were dropped by the server. */ #define HGFS_NOTIFY_FLAG_OVERFLOW (1 << 0) @@ -1997,26 +1811,23 @@ HgfsNotifyEventV4; /* Server generated coasrse grain events. */ #define HGFS_NOTIFY_FLAG_COARSE_GRAIN (1 << 2) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestNotifyV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestNotifyV4 { HgfsSubscriberHandle watchId; /* Watch identifier. */ uint32 flags; /* Various flags. */ uint32 count; /* Number of events occured. */ uint64 reserved; /* Reserved for future use. */ HgfsNotifyEventV4 events[1]; /* Events. HgfsNotifyEvent(s). */ -} -#include "vmware_pack_end.h" -HgfsRequestNotifyV4; +} HgfsRequestNotifyV4; +#pragma pack(pop) // Query EA flags values. #define HGFS_QUERY_EA_INDEX_SPECIFIED (1 << 0) #define HGFS_QUERY_EA_SINGLE_ENTRY (1 << 1) #define HGFS_QUERY_EA_RESTART_SCAN (1 << 2) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestQueryEAV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestQueryEAV4 { uint32 flags; /* EA flags. */ uint32 index; uint64 reserved; /* Reserved for future use. */ @@ -2027,13 +1838,11 @@ struct HgfsRequestQueryEAV4 { * Actual location of the data depends on * fileName length and defined by eaNameOffset. */ -} -#include "vmware_pack_end.h" -HgfsRequestQueryEAV4; +} HgfsRequestQueryEAV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyQueryEAV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyQueryEAV4 { uint32 nextOffset; /* Offset of the next structure when more then * one record is returned. */ @@ -2042,39 +1851,32 @@ struct HgfsReplyQueryEAV4 { uint64 reserved; /* Reserved for future use. */ uint32 eaDataLength; /* EA value length. */ char eaData[1]; /* NULL termianed EA name followed by EA value. */ -} -#include "vmware_pack_end.h" -HgfsReplyQueryEAV4; +} HgfsReplyQueryEAV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsEAV4 { +#pragma pack(push, 1) +typedef struct HgfsEAV4 { uint32 nextOffset; /* Offset of the next structure in the chain. */ uint32 valueLength; /* EA value length. */ char data[1]; /* NULL terminated EA name followed by EA value. */ -} -#include "vmware_pack_end.h" -HgfsEAV4; +} HgfsEAV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSetEAV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestSetEAV4 { uint32 flags; /* Flags, see below. */ uint64 reserved; /* Reserved for future use. */ uint32 numEAs; /* Number of EAs in this request. */ HgfsEAV4 attributes[1]; /* Array of attributes. */ -} -#include "vmware_pack_end.h" -HgfsRequestSetEAV4; +} HgfsRequestSetEAV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySetEAV4 { +#pragma pack(push, 1) +typedef struct HgfsReplySetEAV4 { uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsReplySetEAV4; +} HgfsReplySetEAV4; +#pragma pack(pop) /* * EA Flags. When both flags are set EA is either created or replaced if it exists. @@ -2094,47 +1896,39 @@ HgfsReplySetEAV4; #define HGFS_RANGE_LOCK_EXCLUSIVE (1 << 0) #define HGFS_RANGE_LOCK_FAIL_IMMEDIATLY (1 << 1) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestLockRangeV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestLockRangeV4 { HgfsHandle fid; /* File to take lock on. */ uint32 flags; /* Various flags. */ uint64 start; /* Starting offset in the file. */ uint64 length; /* Number of bytes to lock. */ uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsRequestLockRangeV4; +} HgfsRequestLockRangeV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyLockRangeV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyLockRangeV4 { uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsReplyLockRangeV4; +} HgfsReplyLockRangeV4; +#pragma pack(pop) #define HGFS_RANGE_LOCK_UNLOCK_ALL (1 << 0) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestUnlockRangeV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestUnlockRangeV4 { HgfsHandle fid; /* File to take lock on. */ uint32 flags; /* Various flags. */ uint64 start; /* Starting offset in the file. */ uint64 length; /* Number of bytes to lock. */ uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsRequestUnlockRangeV4; +} HgfsRequestUnlockRangeV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyUnlockRangeV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyUnlockRangeV4 { uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsReplyUnlockRangeV4; +} HgfsReplyUnlockRangeV4; +#pragma pack(pop) /* * There are three types of oplocks: level 1, batch, and level 2. Both the level 1 and @@ -2170,49 +1964,41 @@ HgfsReplyUnlockRangeV4; * HGFS_OPLOCK_BATCH: batch oplock. Read/Write and Open caching is allowed. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestServerLockChangeV2 { +#pragma pack(push, 1) +typedef struct HgfsRequestServerLockChangeV2 { HgfsHandle fid; /* File to take lock on. */ HgfsLockType serverLock; /* Lock type. */ uint64 reserved; -} -#include "vmware_pack_end.h" -HgfsRequestServerLockChangeV2; +} HgfsRequestServerLockChangeV2; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyServerLockChangeV2 { +#pragma pack(push, 1) +typedef struct HgfsReplyServerLockChangeV2 { HgfsLockType serverLock; /* Lock granted. */ uint64 reserved; -} -#include "vmware_pack_end.h" -HgfsReplyServerLockChangeV2; +} HgfsReplyServerLockChangeV2; +#pragma pack(pop) /* * This request is sent from server to the client to notify that oplock * is revoked or downgraded. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestOplockBreakV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestOplockBreakV4 { HgfsHandle fid; /* File handle. */ HgfsLockType serverLock; /* Lock downgraded to this type. */ uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsRequestOplockBreakV4; +} HgfsRequestOplockBreakV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyOplockBreakV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyOplockBreakV4 { HgfsHandle fid; /* File handle. */ HgfsLockType serverLock; /* Lock type. */ uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsReplyOplockBreakV4; +} HgfsReplyOplockBreakV4; +#pragma pack(pop) /* * Flusing of a whole volume is not supported. @@ -2220,44 +2006,36 @@ HgfsReplyOplockBreakV4; * Flusing of directories is supproted on POSIX hosts and is * NOOP on Windows hosts. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestFsyncV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestFsyncV4 { HgfsHandle fid; /* File to sync. */ uint64 reserved; -} -#include "vmware_pack_end.h" -HgfsRequestFsyncV4; +} HgfsRequestFsyncV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyFsyncV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyFsyncV4 { uint64 reserved; -} -#include "vmware_pack_end.h" -HgfsReplyFsyncV4; +} HgfsReplyFsyncV4; +#pragma pack(pop) /* * This request is name based only. * Server fails this request if HGFS_FILE_E_USE_FILE_DESC is set in the fileName. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestAccessCheckV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestAccessCheckV4 { HgfsFileNameV3 fileName; /* File concerned. */ HgfsPermissions perms; /* Permissions to check for. */ uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsRequestAccessCheckV4; +} HgfsRequestAccessCheckV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyAccessCheckV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyAccessCheckV4 { uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsReplyAccessCheckV4; +} HgfsReplyAccessCheckV4; +#pragma pack(pop) /* * Additional HgfsPersmissions type: checks file existense without @@ -2285,26 +2063,22 @@ typedef enum HgfsPlatformType { #define HGFS_FSCTL_SET_SPARSE 1 /* Platform independent FSCTL to make file sparse. */ /* Platform together with the code define exact meaning of the operation. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestFsctlV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestFsctlV4 { HgfsHandle fid; uint32 code; HgfsPlatformType platform; uint32 dataLength; char data[1]; -} -#include "vmware_pack_end.h" -HgfsRequestFsctlV4; +} HgfsRequestFsctlV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyFsctlV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyFsctlV4 { uint32 dataLength; char data[1]; -} -#include "vmware_pack_end.h" -HgfsReplyFsctlV4; +} HgfsReplyFsctlV4; +#pragma pack(pop) /* * Creating a new file or reading file attributes involves ACL. There is a good @@ -2344,9 +2118,8 @@ typedef uint64 HgfsOpenCreateOptions; /* Fail opening if the file already exists and it is a directory. */ #define HGFS_OPENCREATE_OPTION_NON_DIRECTORY (1 << 11) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestOpenV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestOpenV4 { HgfsOpenValid mask; /* Bitmask that specified which fields are valid. */ HgfsOpenMode mode; /* Which type of access requested. See desiredAccess */ HgfsOpenFlags flags; /* Which flags to open the file with */ @@ -2382,9 +2155,8 @@ struct HgfsRequestOpenV4 { HgfsRequestSetEAV4 extendedAttributes; uint32 aclLength; /* Length of the acl field. */ char acl[1]; /* Multi-platform ACL as defined in RFC 3530. */ -} -#include "vmware_pack_end.h" -HgfsRequestOpenV4; +} HgfsRequestOpenV4; +#pragma pack(pop) typedef enum HgfsOpenResult { HGFS_FILE_OPENED, @@ -2400,18 +2172,16 @@ typedef enum HgfsOpenResult { * HGFS client must know what access rights were granted to properly communicate this * information to the IoManager; grantedAccess field is used for this purpose. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyOpenV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyOpenV4 { HgfsHandle file; /* Opaque file ID used by the server */ HgfsLockType grantedLock; /* The type of lock acquired by the server */ HgfsOpenResult openResult; /* Opened/overwritten or a new file created? */ uint32 grantedAccess; /* Granted access rights. */ uint64 fileId; /* Persistent volume-wide unique file id. */ uint64 volumeId; /* Persistent unique volume id. */ -} -#include "vmware_pack_end.h" -HgfsReplyOpenV4; +} HgfsReplyOpenV4; +#pragma pack(pop) /* * Flags that define behaviour of the move/creating hard link operation. @@ -2421,23 +2191,19 @@ typedef uint64 HgfsMoveLinkFlags; #define HGFS_LINKMOVE_FLAG_REPLACE_EXISTING (1 << 0) /* Delete existing target. */ #define HGFS_LINKMOVE_FLAG_HARD_LINK (1 << 1) /* Create hard link. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestLinkMoveV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestLinkMoveV4 { HgfsFileNameV3 oldFileName; /* Path to the exisitng source file.*/ HgfsFileNameV3 newFileName; /* Path to the destinatio name.*/ HgfsMoveLinkFlags flags; /* Flags that define behaviour of the operation.*/ -} -#include "vmware_pack_end.h" -HgfsRequestLinkMoveV4; +} HgfsRequestLinkMoveV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyLinkMove4 { +#pragma pack(push, 1) +typedef struct HgfsReplyLinkMove4 { uint64 reserved; /* Reserved for future use. */ -} -#include "vmware_pack_end.h" -HgfsReplyLinkMove4; +} HgfsReplyLinkMove4; +#pragma pack(pop) /* * HgfsQueryVolumeMaskV4 mask in a request defines which volume properties client needs; @@ -2475,18 +2241,15 @@ typedef uint64 HgfsFileSystemCapabilities; #define HGFS_VOLUME_SUPPORTS_QUOTA (1 << 12) #define HGFS_VOLUME_SUPPORTS_NAMED_STREAMS (1 << 13) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestQueryVolumeV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestQueryVolumeV4 { HgfsQueryVolumeMaskV4 mask; HgfsFileNameV3 name; -} -#include "vmware_pack_end.h" -HgfsRequestQueryVolumeV4; +} HgfsRequestQueryVolumeV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyQueryVolumeV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyQueryVolumeV4 { HgfsQueryVolumeMaskV4 mask; /* Identifies which values were set by the host. */ uint64 totalBytes; /* Total volume capacity. */ uint64 freeBytes; /* Free space on the volume. */ @@ -2497,9 +2260,8 @@ struct HgfsReplyQueryVolumeV4 { uint32 sectorsPerCluster; /* Cluster size for the volume. */ HgfsFileName volumeLabel; /* Volume name or label. */ HgfsFileName fileSystemName;/* File system name. */ -} -#include "vmware_pack_end.h" -HgfsReplyQueryVolumeV4; +} HgfsReplyQueryVolumeV4; +#pragma pack(pop) typedef uint32 HgfsSearchReadMask; #define HGFS_SEARCH_READ_NAME (1 << 0) @@ -2537,9 +2299,8 @@ typedef uint32 HgfsSearchReadFlags; * requested properties. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSearchReadV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestSearchReadV4 { HgfsSearchReadMask mask; HgfsSearchReadFlags flags; HgfsHandle fid; @@ -2547,13 +2308,11 @@ struct HgfsRequestSearchReadV4 { uint32 restartIndex; uint64 reserved; HgfsFileName searchPattern; -} -#include "vmware_pack_end.h" -HgfsRequestSearchReadV4; +} HgfsRequestSearchReadV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsDirEntryV4 { +#pragma pack(push, 1) +typedef struct HgfsDirEntryV4 { uint32 nextEntryOffset; uint32 fileIndex; HgfsSearchReadMask mask; /* Returned mask: may be a subset of requested mask. */ @@ -2571,65 +2330,54 @@ struct HgfsDirEntryV4 { uint64 reserved; /* Reserved for future use. */ HgfsShortFileName shortName; /* Windows only: 8 dot 3 format name. */ HgfsFileName fileName; /* Entry file name. */ -} -#include "vmware_pack_end.h" -HgfsDirEntryV4; +} HgfsDirEntryV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySearchReadV4 { +#pragma pack(push, 1) +typedef struct HgfsReplySearchReadV4 { uint32 numberEntriesReturned; /* number of directory entries in this reply. */ uint32 offsetToContinue; /* Entry index of the directory entry. */ HgfsSearchReadFlags flags; /* Flags to indicate reply specifics */ uint64 reserved; /* Reserved for future use. */ HgfsDirEntryV4 entries[1]; /* Unused as entries transfered using shared memory. */ -} -#include "vmware_pack_end.h" -HgfsReplySearchReadV4; +} HgfsReplySearchReadV4; +#pragma pack(pop) /* * File handle returned by HgfsRequestOpenV4 or later. Descriptors returned by * HgfsHandle fid; earlier versions of HgfsRequestOpen are not supported. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestEnumerateStreamsV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestEnumerateStreamsV4 { uint32 restartIndex; -} -#include "vmware_pack_end.h" -HgfsRequestEnumerateStreamsV4; +} HgfsRequestEnumerateStreamsV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestStreamEntryV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestStreamEntryV4 { uint32 nextEntryOffset; uint32 fileIndex; HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestStreamEntryV4; +} HgfsRequestStreamEntryV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyEnumerateStreamsV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyEnumerateStreamsV4 { uint32 numberEntriesReturned; uint32 offsetToContinue; uint64 reserved; HgfsRequestStreamEntryV4 entries[1]; -} -#include "vmware_pack_end.h" -HgfsReplyEnumerateStreamsV4; +} HgfsReplyEnumerateStreamsV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestGetattrV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestGetattrV4 { uint32 mask; uint32 flags; uint64 reserved; HgfsFileNameV3 name; -} -#include "vmware_pack_end.h" -HgfsRequestGetattrV4; +} HgfsRequestGetattrV4; +#pragma pack(pop) /* * V4 reports different file size for symlinks then V3 or V2. @@ -2649,9 +2397,8 @@ HgfsRequestGetattrV4; * reparse point to the host file. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsAttrV4 { +#pragma pack(push, 1) +typedef struct HgfsAttrV4 { HgfsAttrV2 attr; uint32 numberOfLinks; HgfsFileName shortName; @@ -2659,36 +2406,29 @@ struct HgfsAttrV4 { uint32 aclLength; uint64 reserved; char acl[1]; -} -#include "vmware_pack_end.h" -HgfsAttrV4; +} HgfsAttrV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyGetattrV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyGetattrV4 { HgfsAttrV4 attr; -} -#include "vmware_pack_end.h" -HgfsReplyGetattrV4; +} HgfsReplyGetattrV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestSetattrV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestSetattrV4 { HgfsAttrHint hints; HgfsAttrV2 attr; uint64 reserved; /* Reserved for future use */ HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ -} -#include "vmware_pack_end.h" -HgfsRequestSetattrV4; +} HgfsRequestSetattrV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplySetattrV4 { +#pragma pack(push, 1) +typedef struct HgfsReplySetattrV4 { uint32 mask; /* Defines which attributes were set. */ -} -#include "vmware_pack_end.h" -HgfsReplySetattrV4; +} HgfsReplySetattrV4; +#pragma pack(pop) /* * Unlike V3 deletion this command can be used to delete both files and directories. @@ -2699,20 +2439,16 @@ HgfsReplySetattrV4; * closed - Windows style deletion. */ -typedef -#include "vmware_pack_begin.h" -struct HgfsRequestDeleteFileV4 { +#pragma pack(push, 1) +typedef struct HgfsRequestDeleteFileV4 { HgfsFileNameV3 fileName; -} -#include "vmware_pack_end.h" -HgfsRequestDeleteFileV4; +} HgfsRequestDeleteFileV4; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct HgfsReplyDeleteFileV4 { +#pragma pack(push, 1) +typedef struct HgfsReplyDeleteFileV4 { uint64 reserved; -} -#include "vmware_pack_end.h" -HgfsReplyDeleteFileV4; +} HgfsReplyDeleteFileV4; +#pragma pack(pop) #endif /* _HGFS_PROTO_H_ */ diff --git a/open-vm-tools/lib/include/uuid.h b/open-vm-tools/lib/include/uuid.h index 82c530844..e535c97cb 100644 --- a/open-vm-tools/lib/include/uuid.h +++ b/open-vm-tools/lib/include/uuid.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2018, 2020 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2018, 2020-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -107,18 +107,16 @@ typedef enum { * 33 22 11 00 55 44 77 66 88 99 AA BB CC DD EE FF */ -typedef -#include "vmware_pack_begin.h" -struct { +#pragma pack(push, 1) +typedef struct { uint32 timeLow; uint16 timeMid; uint16 timeHiAndVersion; uint8 clockSeqHiAndReserved; uint8 clockSeqLow; uint8 node[6]; -} -#include "vmware_pack_end.h" -UUIDRFC4122; +} UUIDRFC4122; +#pragma pack(pop) /* @@ -148,16 +146,14 @@ UUIDRFC4122; * little-endian CPU: 33 22 11 00 55 44 77 66 88 99 AA BB CC DD EE FF */ -typedef -#include "vmware_pack_begin.h" -struct { +#pragma pack(push, 1) +typedef struct { uint32 data1; uint16 data2; uint16 data3; uint8 data4[8]; -} -#include "vmware_pack_end.h" -EFIGUID; +} EFIGUID; +#pragma pack(pop) Bool UUID_ConvertPackedToBin(EFIGUID *destID, const char *text); diff --git a/open-vm-tools/lib/include/vixCommands.h b/open-vm-tools/lib/include/vixCommands.h index 9d12170ea..588cba177 100644 --- a/open-vm-tools/lib/include/vixCommands.h +++ b/open-vm-tools/lib/include/vixCommands.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2003-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -153,9 +153,8 @@ enum VixResponseFlagsValues { * currently empty for a response. * */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgHeader { +#pragma pack(push, 1) +typedef struct VixMsgHeader { uint32 magic; uint16 messageVersion; @@ -165,9 +164,8 @@ struct VixMsgHeader { uint32 credentialLength; uint8 commonFlags; -} -#include "vmware_pack_end.h" -VixMsgHeader; +} VixMsgHeader; +#pragma pack(pop) /* @@ -177,9 +175,8 @@ VixMsgHeader; * accept response messages from the VMX, not requests. Because of * this, an event message is a special kind of response message. */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandRequestHeader { +#pragma pack(push, 1) +typedef struct VixCommandRequestHeader { VixMsgHeader commonHeader; uint32 opCode; @@ -191,14 +188,12 @@ struct VixCommandRequestHeader { uint32 clientHandleId; // for remote case uint32 userCredentialType; -} -#include "vmware_pack_end.h" -VixCommandRequestHeader; +} VixCommandRequestHeader; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixCommandResponseHeader { +#pragma pack(push, 1) +typedef struct VixCommandResponseHeader { VixMsgHeader commonHeader; uint64 requestCookie; @@ -210,33 +205,28 @@ struct VixCommandResponseHeader { uint32 error; uint32 additionalError; uint32 errorDataLength; -} -#include "vmware_pack_end.h" -VixCommandResponseHeader; +} VixCommandResponseHeader; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgEventHeader { +#pragma pack(push, 1) +typedef struct VixMsgEventHeader { VixCommandResponseHeader responseHeader; int32 eventType; -} -#include "vmware_pack_end.h" -VixMsgEventHeader; +} VixMsgEventHeader; +#pragma pack(pop) /* * A trivial request that is just a generic * response header (it has no body). */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgTrivialRequest { +#pragma pack(push, 1) +typedef struct VixMsgTrivialRequest { VixCommandRequestHeader header; -} -#include "vmware_pack_end.h" -VixMsgTrivialRequest; +} VixMsgTrivialRequest; +#pragma pack(pop) /* @@ -244,13 +234,11 @@ VixMsgTrivialRequest; * event header (it has no body). */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgTrivialEvent { +#pragma pack(push, 1) +typedef struct VixMsgTrivialEvent { VixMsgEventHeader eventHeader; -} -#include "vmware_pack_end.h" -VixMsgTrivialEvent; +} VixMsgTrivialEvent; +#pragma pack(pop) /* @@ -263,31 +251,27 @@ VixMsgTrivialEvent; * VIX_EVENTTYPE_JOB_PROGRESS as the eventType. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgProgressEvent { +#pragma pack(push, 1) +typedef struct VixMsgProgressEvent { VixMsgEventHeader eventHeader; int64 workToDo; int64 workDone; -} -#include "vmware_pack_end.h" -VixMsgProgressEvent; +} VixMsgProgressEvent; +#pragma pack(pop) /* * This is an event sent from the VMX to all clients when some property changes. * It may be used for any runtime property. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgPropertyChangedEvent { +#pragma pack(push, 1) +typedef struct VixMsgPropertyChangedEvent { VixMsgEventHeader eventHeader; int options; uint32 propertyListSize; -} -#include "vmware_pack_end.h" -VixMsgPropertyChangedEvent; +} VixMsgPropertyChangedEvent; +#pragma pack(pop) @@ -295,38 +279,32 @@ VixMsgPropertyChangedEvent; * ********************************************************** * This is a userName and password pair. */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandNamePassword { +#pragma pack(push, 1) +typedef struct VixCommandNamePassword { uint32 nameLength; uint32 passwordLength; -} -#include "vmware_pack_end.h" -VixCommandNamePassword; +} VixCommandNamePassword; +#pragma pack(pop) /* * ********************************************************** * This is a ticketed session for authentication. */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandTicketedSession { +#pragma pack(push, 1) +typedef struct VixCommandTicketedSession { uint32 ticketLength; -} -#include "vmware_pack_end.h" -VixCommandTicketedSession; +} VixCommandTicketedSession; +#pragma pack(pop) /* * ********************************************************** * This is a SSPI token for acquiring credentials */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandSSPI { +#pragma pack(push, 1) +typedef struct VixCommandSSPI { uint32 tokenLength; -} -#include "vmware_pack_end.h" -VixCommandSSPI; +} VixCommandSSPI; +#pragma pack(pop) /* @@ -334,23 +312,20 @@ VixCommandSSPI; * This is a SAML bearer token with optional userName to specify * an IdProvider store. */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandSAMLToken { +#pragma pack(push, 1) +typedef struct VixCommandSAMLToken { uint32 tokenLength; uint32 nameLength; -} -#include "vmware_pack_end.h" -VixCommandSAMLToken; +} VixCommandSAMLToken; +#pragma pack(pop) /* * ********************************************************** * Basic power op request. The response is just a generic * response header (it has no body). */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgPowerOpRequest { +#pragma pack(push, 1) +typedef struct VixMsgPowerOpRequest { VixCommandRequestHeader header; VixVMPowerOpOptions powerOpOptions; /* @@ -358,9 +333,8 @@ struct VixMsgPowerOpRequest { * can be appended here. This was originally used for augmenting * poweroff to support revert to snapshot upon poweroff functionality. */ -} -#include "vmware_pack_end.h" -VixMsgPowerOpRequest; +} VixMsgPowerOpRequest; +#pragma pack(pop) /* @@ -368,37 +342,31 @@ VixMsgPowerOpRequest; * Get/Set Properties Request */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgGetVMStateResponse { +#pragma pack(push, 1) +typedef struct VixMsgGetVMStateResponse { VixCommandResponseHeader header; uint32 bufferSize; // This is followed by the buffer of serialized properties -} -#include "vmware_pack_end.h" -VixMsgGetVMStateResponse; +} VixMsgGetVMStateResponse; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgSetVMStateRequest { +#pragma pack(push, 1) +typedef struct VixMsgSetVMStateRequest { VixCommandRequestHeader header; uint32 bufferSize; // This is followed by the buffer of serialized properties -} -#include "vmware_pack_end.h" -VixMsgSetVMStateRequest; +} VixMsgSetVMStateRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgAuthDataV1 { +#pragma pack(push, 1) +typedef struct VixMsgAuthDataV1 { int64 nonce; uint32 sequenceNumber; uint8 hashValue[32]; -} -#include "vmware_pack_end.h" -VixMsgAuthDataV1; +} VixMsgAuthDataV1; +#pragma pack(pop) @@ -407,14 +375,12 @@ VixMsgAuthDataV1; * Basic reload state request. The response is just a generic * response header (it has no body). */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgReloadVMStateRequest { +#pragma pack(push, 1) +typedef struct VixMsgReloadVMStateRequest { VixCommandRequestHeader header; // This is followed by an array of VixMsgConfigurationObjectType objects -} -#include "vmware_pack_end.h" -VixMsgReloadVMStateRequest; +} VixMsgReloadVMStateRequest; +#pragma pack(pop) /* @@ -425,18 +391,15 @@ VixMsgReloadVMStateRequest; * * VIX_NETWORK_SETTING_CONFIG - VixMsgNICBandwidth */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgConfigurationObjectType { +#pragma pack(push, 1) +typedef struct VixMsgConfigurationObjectType { int32 configurationType; uint32 objectSize; -} -#include "vmware_pack_end.h" -VixMsgConfigurationObjectType; +} VixMsgConfigurationObjectType; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgNICBandwidth { +#pragma pack(push, 1) +typedef struct VixMsgNICBandwidth { Bool validNICNum; int32 nicNum; char pvnGUID[64]; @@ -454,18 +417,15 @@ struct VixMsgNICBandwidth { uint32 maxLatency; uint32 options; -} -#include "vmware_pack_end.h" -VixMsgNICBandwidth; +} VixMsgNICBandwidth; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgLANSegmentConfiguration { +#pragma pack(push, 1) +typedef struct VixMsgLANSegmentConfiguration { VixMsgConfigurationObjectType configHeader; VixMsgNICBandwidth lanSegment; -} -#include "vmware_pack_end.h" -VixMsgLANSegmentConfiguration; +} VixMsgLANSegmentConfiguration; +#pragma pack(pop) /* * These are options to the bandwidth commands. @@ -488,15 +448,13 @@ enum VixMsgConfigObjectType { * Wait for tools request. The response is just a generic * response header (it has no body). */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgWaitForToolsRequest { +#pragma pack(push, 1) +typedef struct VixMsgWaitForToolsRequest { VixCommandRequestHeader header; int32 timeoutInSeconds; int32 minVersion; -} -#include "vmware_pack_end.h" -VixMsgWaitForToolsRequest; +} VixMsgWaitForToolsRequest; +#pragma pack(pop) @@ -504,34 +462,29 @@ VixMsgWaitForToolsRequest; * ********************************************************** * Run a program on the guest. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgRunProgramRequest { +#pragma pack(push, 1) +typedef struct VixMsgRunProgramRequest { VixCommandRequestHeader header; int32 runProgramOptions; uint32 programNameLength; uint32 commandLineArgsLength; -} -#include "vmware_pack_end.h" -VixMsgRunProgramRequest; +} VixMsgRunProgramRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgOldRunProgramResponse { +#pragma pack(push, 1) +typedef struct VixMsgOldRunProgramResponse { VixCommandResponseHeader header; int32 exitCode; VmTimeType deltaTime; -} -#include "vmware_pack_end.h" -VixMsgOldRunProgramResponse; +} VixMsgOldRunProgramResponse; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgRunProgramResponse { +#pragma pack(push, 1) +typedef struct VixMsgRunProgramResponse { VixCommandResponseHeader header; int32 exitCode; @@ -540,25 +493,22 @@ struct VixMsgRunProgramResponse { int64 pid; uint32 stdOutLength; uint32 stdErrLength; -} -#include "vmware_pack_end.h" -VixMsgRunProgramResponse; +} VixMsgRunProgramResponse; +#pragma pack(pop) /* * ********************************************************** * Install VMware tools. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgInstallToolsRequest { +#pragma pack(push, 1) +typedef struct VixMsgInstallToolsRequest { VixCommandRequestHeader header; int32 installOptions; uint32 commandLineArgsLength; -} -#include "vmware_pack_end.h" -VixMsgInstallToolsRequest; +} VixMsgInstallToolsRequest; +#pragma pack(pop) @@ -583,22 +533,19 @@ enum VixKeyStrokeModifiers { }; -typedef -#include "vmware_pack_begin.h" -struct VixMsgKeyStroke { +#pragma pack(push, 1) +typedef struct VixMsgKeyStroke { int32 modifier; int32 scanCode; int32 duration; int32 delayAfterKeyUp; int32 repeat; -} -#include "vmware_pack_end.h" -VixMsgKeyStroke; +} VixMsgKeyStroke; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgSendKeyStrokesRequest { +#pragma pack(push, 1) +typedef struct VixMsgSendKeyStrokesRequest { VixCommandRequestHeader header; int32 keyStrokeType; @@ -606,26 +553,23 @@ struct VixMsgSendKeyStrokesRequest { int64 targetPid; int32 numKeyStrokes; uint32 windowNameLength; -} -#include "vmware_pack_end.h" -VixMsgSendKeyStrokesRequest; +} VixMsgSendKeyStrokesRequest; +#pragma pack(pop) /* * send a mouse event to the guest */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgSendMouseEventRequest { +#pragma pack(push, 1) +typedef struct VixMsgSendMouseEventRequest { VixCommandRequestHeader header; int16 x; int16 y; int16 buttons; int32 options; -} -#include "vmware_pack_end.h" -VixMsgSendMouseEventRequest; +} VixMsgSendMouseEventRequest; +#pragma pack(pop) @@ -634,17 +578,15 @@ VixMsgSendMouseEventRequest; * ********************************************************** * Read or write the registry on the guest. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgRegistryRequest { +#pragma pack(push, 1) +typedef struct VixMsgRegistryRequest { VixCommandRequestHeader header; uint32 registryKeyLength; int32 expectedRegistryKeyType; uint32 dataToWriteSize; -} -#include "vmware_pack_end.h" -VixMsgRegistryRequest; +} VixMsgRegistryRequest; +#pragma pack(pop) @@ -652,22 +594,19 @@ VixMsgRegistryRequest; * ********************************************************** * Copy files between the host and the guest. */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandRenameFileRequest { +#pragma pack(push, 1) +typedef struct VixCommandRenameFileRequest { VixCommandRequestHeader header; int32 copyFileOptions; uint32 oldPathNameLength; uint32 newPathNameLength; uint32 filePropertiesLength; -} -#include "vmware_pack_end.h" -VixCommandRenameFileRequest; +} VixCommandRenameFileRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixCommandRenameFileRequestEx { +#pragma pack(push, 1) +typedef struct VixCommandRenameFileRequestEx { VixCommandRequestHeader header; int32 copyFileOptions; @@ -675,24 +614,20 @@ struct VixCommandRenameFileRequestEx { uint32 newPathNameLength; uint32 filePropertiesLength; Bool overwrite; -} -#include "vmware_pack_end.h" -VixCommandRenameFileRequestEx; +} VixCommandRenameFileRequestEx; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixCommandHgfsSendPacket { +#pragma pack(push, 1) +typedef struct VixCommandHgfsSendPacket { VixCommandRequestHeader header; uint32 hgfsPacketSize; int32 timeout; -} -#include "vmware_pack_end.h" -VixCommandHgfsSendPacket; +} VixCommandHgfsSendPacket; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgSetGuestFileAttributesRequest { +#pragma pack(push, 1) +typedef struct VixMsgSetGuestFileAttributesRequest { VixCommandRequestHeader header; int32 fileOptions; @@ -704,9 +639,8 @@ struct VixMsgSetGuestFileAttributesRequest { Bool hidden; Bool readOnly; uint32 guestPathNameLength; -} -#include "vmware_pack_end.h" -VixMsgSetGuestFileAttributesRequest; +} VixMsgSetGuestFileAttributesRequest; +#pragma pack(pop) /* @@ -714,36 +648,31 @@ VixMsgSetGuestFileAttributesRequest; * Perform a simple operation (like delete or check for existence) * on a file or registry key on the guest. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgSimpleFileRequest { +#pragma pack(push, 1) +typedef struct VixMsgSimpleFileRequest { VixCommandRequestHeader header; int32 fileOptions; uint32 guestPathNameLength; -} -#include "vmware_pack_end.h" -VixMsgSimpleFileRequest; +} VixMsgSimpleFileRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgListDirectoryRequest { +#pragma pack(push, 1) +typedef struct VixMsgListDirectoryRequest { VixCommandRequestHeader header; int32 fileOptions; uint32 guestPathNameLength; int64 offset; -} -#include "vmware_pack_end.h" -VixMsgListDirectoryRequest; +} VixMsgListDirectoryRequest; +#pragma pack(pop) enum VixListDirectoryOptions { VIX_LIST_DIRECTORY_USE_OFFSET = 0x01 }; -typedef -#include "vmware_pack_begin.h" -struct VixMsgListFilesRequest { +#pragma pack(push, 1) +typedef struct VixMsgListFilesRequest { VixCommandRequestHeader header; int32 fileOptions; @@ -752,35 +681,30 @@ struct VixMsgListFilesRequest { int32 index; int32 maxResults; uint64 offset; -} -#include "vmware_pack_end.h" -VixMsgListFilesRequest; +} VixMsgListFilesRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixCommandInitiateFileTransferToGuestRequest { +#pragma pack(push, 1) +typedef struct VixCommandInitiateFileTransferToGuestRequest { VixCommandRequestHeader header; int32 options; uint32 guestPathNameLength; Bool overwrite; -} -#include "vmware_pack_end.h" -VixCommandInitiateFileTransferToGuestRequest; +} VixCommandInitiateFileTransferToGuestRequest; +#pragma pack(pop) /* * This is used to reply to several operations, like testing whether * a file or registry key exists on the client. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgCheckExistsResponse { +#pragma pack(push, 1) +typedef struct VixMsgCheckExistsResponse { VixCommandResponseHeader header; Bool exists; -} -#include "vmware_pack_end.h" -VixMsgCheckExistsResponse; +} VixMsgCheckExistsResponse; +#pragma pack(pop) /* @@ -789,160 +713,138 @@ VixMsgCheckExistsResponse; * on a file in the guest. This lets you pass in things like the initial file * properties. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgCreateFileRequest { +#pragma pack(push, 1) +typedef struct VixMsgCreateFileRequest { VixCommandRequestHeader header; int32 fileOptions; uint32 guestPathNameLength; uint32 filePropertiesLength; -} -#include "vmware_pack_end.h" -VixMsgCreateFileRequest; +} VixMsgCreateFileRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgCreateFileRequestEx { +#pragma pack(push, 1) +typedef struct VixMsgCreateFileRequestEx { VixCommandRequestHeader header; int32 fileOptions; uint32 guestPathNameLength; uint32 filePropertiesLength; Bool createParentDirectories; -} -#include "vmware_pack_end.h" -VixMsgCreateFileRequestEx; +} VixMsgCreateFileRequestEx; +#pragma pack(pop) /* * ********************************************************** * Hot extend a disk in a running VM. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgHotExtendDiskRequest { +#pragma pack(push, 1) +typedef struct VixMsgHotExtendDiskRequest { VixCommandRequestHeader header; int32 hotDiskOptions; uint32 typeLength; int32 adapterNum; int32 targetNum; uint64 newNumSectors; -} -#include "vmware_pack_end.h" -VixMsgHotExtendDiskRequest; +} VixMsgHotExtendDiskRequest; +#pragma pack(pop) /* * ********************************************************** * Hot plug CPU in a running VM. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgHotPlugCPURequest { +#pragma pack(push, 1) +typedef struct VixMsgHotPlugCPURequest { VixCommandRequestHeader header; uint32 newNumCPU; -} -#include "vmware_pack_end.h" -VixMsgHotPlugCPURequest; +} VixMsgHotPlugCPURequest; +#pragma pack(pop) /* * ********************************************************** * Hot plug memory in a running VM. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgHotPlugMemoryRequest { +#pragma pack(push, 1) +typedef struct VixMsgHotPlugMemoryRequest { VixCommandRequestHeader header; uint32 newSizeMb; -} -#include "vmware_pack_end.h" -VixMsgHotPlugMemoryRequest; +} VixMsgHotPlugMemoryRequest; +#pragma pack(pop) /* * ********************************************************** * Hot add device in a running VM. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgHotAddDeviceRequest { +#pragma pack(push, 1) +typedef struct VixMsgHotAddDeviceRequest { VixCommandRequestHeader header; int32 deviceType; uint32 devicePropsBufferSize; int32 backingType; uint32 backingPropsBufferSize; -} -#include "vmware_pack_end.h" -VixMsgHotAddDeviceRequest; +} VixMsgHotAddDeviceRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgHotAddDeviceResponse { +#pragma pack(push, 1) +typedef struct VixMsgHotAddDeviceResponse { VixCommandResponseHeader header; int32 adapterNum; int32 targetNum; -} -#include "vmware_pack_end.h" -VixMsgHotAddDeviceResponse; +} VixMsgHotAddDeviceResponse; +#pragma pack(pop) /* * ********************************************************** * Hot remove device in a running VM. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgHotRemoveDeviceRequest { +#pragma pack(push, 1) +typedef struct VixMsgHotRemoveDeviceRequest { VixCommandRequestHeader header; int32 deviceType; uint32 devicePropsBufferSize; -} -#include "vmware_pack_end.h" -VixMsgHotRemoveDeviceRequest; +} VixMsgHotRemoveDeviceRequest; +#pragma pack(pop) /* * ********************************************************** * Change monitor type of a running VM. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgHotChangeMonitorTypeRequest { +#pragma pack(push, 1) +typedef struct VixMsgHotChangeMonitorTypeRequest { VixCommandRequestHeader header; int32 monitorType; -} -#include "vmware_pack_end.h" -VixMsgHotChangeMonitorTypeRequest; +} VixMsgHotChangeMonitorTypeRequest; +#pragma pack(pop) /* * ********************************************************** * Hot plug begin batch. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgHotPlugBeginBatchRequest { +#pragma pack(push, 1) +typedef struct VixMsgHotPlugBeginBatchRequest { VixCommandRequestHeader header; int32 flags; -} -#include "vmware_pack_end.h" -VixMsgHotPlugBeginBatchRequest; +} VixMsgHotPlugBeginBatchRequest; +#pragma pack(pop) /* * ********************************************************** * Hot plug commit batch. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgHotPlugCommitBatchRequest { +#pragma pack(push, 1) +typedef struct VixMsgHotPlugCommitBatchRequest { VixCommandRequestHeader header; int32 status; -} -#include "vmware_pack_end.h" -VixMsgHotPlugCommitBatchRequest; +} VixMsgHotPlugCommitBatchRequest; +#pragma pack(pop) /* @@ -950,18 +852,16 @@ VixMsgHotPlugCommitBatchRequest; * Transfer connection. Besides fields here you are supposed to * receive file descriptor OOB. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgTransferConnectionRequest { +#pragma pack(push, 1) +typedef struct VixMsgTransferConnectionRequest { VixCommandRequestHeader header; Bool isPrivileged; uint32 cryptoLength; uint32 fdLength; /* uint8 cryptoData[]; */ /* uint8 fdData[]; */ -} -#include "vmware_pack_end.h" -VixMsgTransferConnectionRequest; +} VixMsgTransferConnectionRequest; +#pragma pack(pop) /* @@ -971,17 +871,15 @@ VixMsgTransferConnectionRequest; * on original connection already transferred via * TransferConnectionRequest. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgTransferRequestRequest { +#pragma pack(push, 1) +typedef struct VixMsgTransferRequestRequest { VixCommandRequestHeader header; uint32 dataLength; uint32 fdLength; /* uint8 data[]; */ /* uint8 fdData[]; */ -} -#include "vmware_pack_end.h" -VixMsgTransferRequestRequest; +} VixMsgTransferRequestRequest; +#pragma pack(pop) /* @@ -990,26 +888,23 @@ VixMsgTransferRequestRequest; * file descriptor. Data is just what was already received * on the socket passed by TransferConnectionRequest. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgTransferFinalDataRequest { +#pragma pack(push, 1) +typedef struct VixMsgTransferFinalDataRequest { VixCommandRequestHeader header; uint32 dataLength; uint32 fdLength; /* uint8 data[]; */ /* uint8 fdData[]; */ -} -#include "vmware_pack_end.h" -VixMsgTransferFinalDataRequest; +} VixMsgTransferFinalDataRequest; +#pragma pack(pop) /* * ********************************************************** * Create a snapshot of a running VM. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgCreateSnapshotRequest { +#pragma pack(push, 1) +typedef struct VixMsgCreateSnapshotRequest { VixCommandRequestHeader header; int32 options; @@ -1019,38 +914,32 @@ struct VixMsgCreateSnapshotRequest { uint32 nameLength; uint32 descriptionLength; -} -#include "vmware_pack_end.h" -VixMsgCreateSnapshotRequest; +} VixMsgCreateSnapshotRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgCreateSnapshotResponse { +#pragma pack(push, 1) +typedef struct VixMsgCreateSnapshotResponse { VixCommandResponseHeader header; int32 snapshotUID; -} -#include "vmware_pack_end.h" -VixMsgCreateSnapshotResponse; +} VixMsgCreateSnapshotResponse; +#pragma pack(pop) /* * Several snapshot operations for a running VM. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgSnapshotRequest { +#pragma pack(push, 1) +typedef struct VixMsgSnapshotRequest { VixCommandRequestHeader header; int32 options; int32 snapshotId; -} -#include "vmware_pack_end.h" -VixMsgSnapshotRequest; +} VixMsgSnapshotRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgSnapshotUpdateEvent { +#pragma pack(push, 1) +typedef struct VixMsgSnapshotUpdateEvent { VixMsgEventHeader eventHeader; int32 options; @@ -1058,24 +947,20 @@ struct VixMsgSnapshotUpdateEvent { /* * This is followed by a serialized property list. */ -} -#include "vmware_pack_end.h" -VixMsgSnapshotUpdateEvent; +} VixMsgSnapshotUpdateEvent; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgSnapshotMRURequest { +#pragma pack(push, 1) +typedef struct VixMsgSnapshotMRURequest { VixCommandRequestHeader header; int32 snapshotId; int32 maxMRU; -} -#include "vmware_pack_end.h" -VixMsgSnapshotMRURequest; +} VixMsgSnapshotMRURequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgSetSnapshotInfoRequest { +#pragma pack(push, 1) +typedef struct VixMsgSetSnapshotInfoRequest { VixCommandRequestHeader header; int32 snapshotId; @@ -1093,23 +978,19 @@ struct VixMsgSetSnapshotInfoRequest { * description string * serialized property list. */ -} -#include "vmware_pack_end.h" -VixMsgSetSnapshotInfoRequest; +} VixMsgSetSnapshotInfoRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgSetSnapshotInfoResponse { +#pragma pack(push, 1) +typedef struct VixMsgSetSnapshotInfoResponse { VixCommandResponseHeader header; uint32 propertyListLength; -} -#include "vmware_pack_end.h" -VixMsgSetSnapshotInfoResponse; +} VixMsgSetSnapshotInfoResponse; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgRemoveBulkSnapshotRequest { +#pragma pack(push, 1) +typedef struct VixMsgRemoveBulkSnapshotRequest { VixCommandRequestHeader header; int32 options; @@ -1117,92 +998,79 @@ struct VixMsgRemoveBulkSnapshotRequest { /* * This is followed by numSnapshots snapshotIDs. */ -} -#include "vmware_pack_end.h" -VixMsgRemoveBulkSnapshotRequest; +} VixMsgRemoveBulkSnapshotRequest; +#pragma pack(pop) /* * Stop recording or playback of a snapshot event log. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgVMSnapshotPauseRequest { +#pragma pack(push, 1) +typedef struct VixMsgVMSnapshotPauseRequest { VixCommandRequestHeader header; int32 options; -} -#include "vmware_pack_end.h" -VixMsgVMSnapshotPauseRequest; +} VixMsgVMSnapshotPauseRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgDebuggerEvent { +#pragma pack(push, 1) +typedef struct VixMsgDebuggerEvent { VixMsgEventHeader eventHeader; int32 blobLength; /* * This is followed by the blob buffer. */ -} -#include "vmware_pack_end.h" -VixMsgDebuggerEvent; +} VixMsgDebuggerEvent; +#pragma pack(pop) /* * ********************************************************** * Shared folder operations. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgSharedFolderRequest { +#pragma pack(push, 1) +typedef struct VixMsgSharedFolderRequest { VixCommandRequestHeader header; int32 options; int32 index; uint32 shareNameLength; uint32 hostPathNameLength; -} -#include "vmware_pack_end.h" -VixMsgSharedFolderRequest; +} VixMsgSharedFolderRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgSharedFolderResponse { +#pragma pack(push, 1) +typedef struct VixMsgSharedFolderResponse { VixCommandResponseHeader header; int32 numSharedFolders; -} -#include "vmware_pack_end.h" -VixMsgSharedFolderResponse; +} VixMsgSharedFolderResponse; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgGetSharedFolderInfoResponse { +#pragma pack(push, 1) +typedef struct VixMsgGetSharedFolderInfoResponse { VixCommandResponseHeader header; uint32 shareNameLength; uint32 hostPathNameLength; int32 sharedFolderFlags; -} -#include "vmware_pack_end.h" -VixMsgGetSharedFolderInfoResponse; +} VixMsgGetSharedFolderInfoResponse; +#pragma pack(pop) /* * Add or change a shared folder request. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgSetSharedFolderRequest { +#pragma pack(push, 1) +typedef struct VixMsgSetSharedFolderRequest { VixCommandRequestHeader header; int32 options; uint32 shareNameLength; uint32 hostPathNameLength; -} -#include "vmware_pack_end.h" -VixMsgSetSharedFolderRequest; +} VixMsgSetSharedFolderRequest; +#pragma pack(pop) /* @@ -1210,9 +1078,8 @@ VixMsgSetSharedFolderRequest; * Capture the screen of a VM */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgCaptureScreenRequest { +#pragma pack(push, 1) +typedef struct VixMsgCaptureScreenRequest { VixCommandRequestHeader header; int32 format; // Identifies the requested data format. @@ -1220,28 +1087,24 @@ struct VixMsgCaptureScreenRequest { // (-1 is any size) int32 captureScreenOptions; -} -#include "vmware_pack_end.h" -VixMsgCaptureScreenRequest; +} VixMsgCaptureScreenRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgCaptureScreenResponse { +#pragma pack(push, 1) +typedef struct VixMsgCaptureScreenResponse { VixCommandResponseHeader header; int32 format; // Format of the data in the response. uint32 dataOffset; // Relative to the address of this struct. -} -#include "vmware_pack_end.h" -VixMsgCaptureScreenResponse; +} VixMsgCaptureScreenResponse; +#pragma pack(pop) /* * ********************************************************** * Run a script in the guest. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgRunScriptRequest { +#pragma pack(push, 1) +typedef struct VixMsgRunScriptRequest { VixCommandRequestHeader header; int32 scriptOptions; @@ -1249,9 +1112,8 @@ struct VixMsgRunScriptRequest { uint32 interpreterNameLength; uint32 scriptLength; uint32 propertiesLength; -} -#include "vmware_pack_end.h" -VixMsgRunScriptRequest; +} VixMsgRunScriptRequest; +#pragma pack(pop) /* @@ -1259,23 +1121,20 @@ VixMsgRunScriptRequest; * An unsupported command. This is used to test future versions * of the API sending us commands we don't recognize. */ -typedef -#include "vmware_pack_begin.h" -struct VixUnsupportedCommandRequest { +#pragma pack(push, 1) +typedef struct VixUnsupportedCommandRequest { VixCommandRequestHeader header; char junk[2053]; -} -#include "vmware_pack_end.h" -VixUnsupportedCommandRequest; +} VixUnsupportedCommandRequest; +#pragma pack(pop) /* * ********************************************************** * Create a session key between the client and the VMX. */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandMakeSessionKeyRequest { +#pragma pack(push, 1) +typedef struct VixCommandMakeSessionKeyRequest { VixCommandRequestHeader header; int32 keyOptions; @@ -1283,34 +1142,29 @@ struct VixCommandMakeSessionKeyRequest { uint32 responseKeyLength; int32 responseKeyCypherType; int32 cypherType; -} -#include "vmware_pack_end.h" -VixCommandMakeSessionKeyRequest; +} VixCommandMakeSessionKeyRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixCommandMakeSessionKeyResponse { +#pragma pack(push, 1) +typedef struct VixCommandMakeSessionKeyResponse { VixCommandResponseHeader header; int32 keyOptions; int32 timeout; uint32 keyLength; int32 cypherType; -} -#include "vmware_pack_end.h" -VixCommandMakeSessionKeyResponse; +} VixCommandMakeSessionKeyResponse; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixCommandGenerateNonceResponse { +#pragma pack(push, 1) +typedef struct VixCommandGenerateNonceResponse { VixCommandResponseHeader header; int64 nonce; -} -#include "vmware_pack_end.h" -VixCommandGenerateNonceResponse; +} VixCommandGenerateNonceResponse; +#pragma pack(pop) enum { @@ -1324,54 +1178,47 @@ enum { * Kill a guest process. */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandKillProcessRequest { +#pragma pack(push, 1) +typedef struct VixCommandKillProcessRequest { VixCommandRequestHeader header; uint64 pid; uint32 options; -} -#include "vmware_pack_end.h" -VixCommandKillProcessRequest; +} VixCommandKillProcessRequest; +#pragma pack(pop) /* * ********************************************************** * Read and write variables like guest variables and config values. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgReadVariableRequest { +#pragma pack(push, 1) +typedef struct VixMsgReadVariableRequest { VixCommandRequestHeader header; int32 variableType; int32 options; uint32 nameLength; -} -#include "vmware_pack_end.h" -VixMsgReadVariableRequest; +} VixMsgReadVariableRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgReadVariableResponse { +#pragma pack(push, 1) +typedef struct VixMsgReadVariableResponse { VixCommandResponseHeader header; int32 valueType; int32 valueProperties; uint32 valueLength; -} -#include "vmware_pack_end.h" -VixMsgReadVariableResponse; +} VixMsgReadVariableResponse; +#pragma pack(pop) /* * Several snapshot operations for a running VM. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgWriteVariableRequest { +#pragma pack(push, 1) +typedef struct VixMsgWriteVariableRequest { VixCommandRequestHeader header; int32 variableType; @@ -1379,9 +1226,8 @@ struct VixMsgWriteVariableRequest { uint32 nameLength; uint32 valueLength; -} -#include "vmware_pack_end.h" -VixMsgWriteVariableRequest; +} VixMsgWriteVariableRequest; +#pragma pack(pop) @@ -1391,23 +1237,20 @@ VixMsgWriteVariableRequest; * on a file in the guest. This lets you pass in things like the initial file * properties. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgCreateTempFileRequest { +#pragma pack(push, 1) +typedef struct VixMsgCreateTempFileRequest { VixCommandRequestHeader header; int32 options; uint32 propertyNameLength; uint32 filePrefixLength; uint32 fileSuffixLength; -} -#include "vmware_pack_end.h" -VixMsgCreateTempFileRequest; +} VixMsgCreateTempFileRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgCreateTempFileRequestEx { +#pragma pack(push, 1) +typedef struct VixMsgCreateTempFileRequestEx { VixCommandRequestHeader header; int32 options; @@ -1415,69 +1258,60 @@ struct VixMsgCreateTempFileRequestEx { uint32 fileSuffixLength; uint32 directoryPathLength; uint32 propertyListLength; -} -#include "vmware_pack_end.h" -VixMsgCreateTempFileRequestEx; +} VixMsgCreateTempFileRequestEx; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct { +#pragma pack(push, 1) +typedef struct { VixCommandRequestHeader header; int32 fileOptions; uint32 guestPathNameLength; uint32 filePropertiesLength; Bool recursive; -} -#include "vmware_pack_end.h" -VixMsgDeleteDirectoryRequest; +} VixMsgDeleteDirectoryRequest; +#pragma pack(pop) /* * ********************************************************** * Connect/Disconnect device request. The response is just a generic * response header (it has no body). */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgConnectDeviceRequest { +#pragma pack(push, 1) +typedef struct VixMsgConnectDeviceRequest { VixCommandRequestHeader header; int32 options; Bool connected; uint32 nameLength; -} -#include "vmware_pack_end.h" -VixMsgConnectDeviceRequest; +} VixMsgConnectDeviceRequest; +#pragma pack(pop) /* * ********************************************************** * Get the state of a virtual device. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgGetDeviceStateRequest { +#pragma pack(push, 1) +typedef struct VixMsgGetDeviceStateRequest { VixCommandRequestHeader header; int32 options; uint32 nameLength; -} -#include "vmware_pack_end.h" -VixMsgGetDeviceStateRequest; +} VixMsgGetDeviceStateRequest; +#pragma pack(pop) /* * This is used to reply to IsDeviceConnected operations. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgGetDeviceStateResponse { +#pragma pack(push, 1) +typedef struct VixMsgGetDeviceStateResponse { VixCommandResponseHeader header; Bool connected; int32 stateFlags; // Maybe capacity and percent allocated? -} -#include "vmware_pack_end.h" -VixMsgGetDeviceStateResponse; +} VixMsgGetDeviceStateResponse; +#pragma pack(pop) /* @@ -1485,15 +1319,13 @@ VixMsgGetDeviceStateResponse; * Enable/disable all shared folders on this VM. The response * is just a generic response header (it has no body). */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgEnableSharedFoldersRequest { +#pragma pack(push, 1) +typedef struct VixMsgEnableSharedFoldersRequest { VixCommandRequestHeader header; Bool enabled; int32 sharedFolderOptions; -} -#include "vmware_pack_end.h" -VixMsgEnableSharedFoldersRequest; +} VixMsgEnableSharedFoldersRequest; +#pragma pack(pop) /* @@ -1507,9 +1339,8 @@ enum VixMountOptions { }; -typedef -#include "vmware_pack_begin.h" -struct VixMsgMountHGFSRequest { +#pragma pack(push, 1) +typedef struct VixMsgMountHGFSRequest { VixCommandRequestHeader header; int32 mountOptions; @@ -1517,46 +1348,40 @@ struct VixMsgMountHGFSRequest { /* The str path list has the form "host1\0dest1\0host2\0dest2\0host3\0dest3\0\0" */ uint32 pathListLength; -} -#include "vmware_pack_end.h" -VixMsgMountHGFSRequest; +} VixMsgMountHGFSRequest; +#pragma pack(pop) /* * Get guest networking config */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgGetGuestNetworkingConfigRequest { +#pragma pack(push, 1) +typedef struct VixMsgGetGuestNetworkingConfigRequest { VixCommandRequestHeader header; int32 options; -} -#include "vmware_pack_end.h" -VixMsgGetGuestNetworkingConfigRequest; +} VixMsgGetGuestNetworkingConfigRequest; +#pragma pack(pop) /* * Set guest networking config */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgSetGuestNetworkingConfigRequest { +#pragma pack(push, 1) +typedef struct VixMsgSetGuestNetworkingConfigRequest { VixCommandRequestHeader header; int32 options; uint32 bufferSize; -} -#include "vmware_pack_end.h" -VixMsgSetGuestNetworkingConfigRequest; +} VixMsgSetGuestNetworkingConfigRequest; +#pragma pack(pop) /* * Query VMX performance data */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgGetPerformanceDataRequest { +#pragma pack(push, 1) +typedef struct VixMsgGetPerformanceDataRequest { VixCommandRequestHeader header; // unused for now, but left for future expansion in case we @@ -1564,27 +1389,23 @@ struct VixMsgGetPerformanceDataRequest { int32 options; uint32 sizeOfPropertyList; // This is followed by the buffer of properties we wish to fetch -} -#include "vmware_pack_end.h" -VixMsgGetPerformanceDataRequest; +} VixMsgGetPerformanceDataRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgGetPerformanceDataResponse { +#pragma pack(push, 1) +typedef struct VixMsgGetPerformanceDataResponse { VixCommandResponseHeader header; uint32 bufferSize; // This is followed by the buffer of serialized properties -} -#include "vmware_pack_end.h" -VixMsgGetPerformanceDataResponse; +} VixMsgGetPerformanceDataResponse; +#pragma pack(pop) /* * Run a program in guest with (VI version with more args) */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgStartProgramRequest { +#pragma pack(push, 1) +typedef struct VixMsgStartProgramRequest { VixCommandRequestHeader header; Bool startMinimized; @@ -1595,13 +1416,11 @@ struct VixMsgStartProgramRequest { uint32 envVarLength; // This is followed by the buffer of the args -} -#include "vmware_pack_end.h" -VixMsgStartProgramRequest; +} VixMsgStartProgramRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgListProcessesExRequest { +#pragma pack(push, 1) +typedef struct VixMsgListProcessesExRequest { VixCommandRequestHeader header; // if we need to make multiple trips, this is the key used to identify @@ -1614,28 +1433,24 @@ struct VixMsgListProcessesExRequest { uint32 numPids; // This is followed by the list of uint64s -} -#include "vmware_pack_end.h" -VixMsgListProcessesExRequest; +} VixMsgListProcessesExRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgReadEnvironmentVariablesRequest { +#pragma pack(push, 1) +typedef struct VixMsgReadEnvironmentVariablesRequest { VixCommandRequestHeader header; uint32 numNames; uint32 namesLength; // This is followed by the list of NUL-terminated names -} -#include "vmware_pack_end.h" -VixMsgReadEnvironmentVariablesRequest; +} VixMsgReadEnvironmentVariablesRequest; +#pragma pack(pop) /* IdProvider support */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgAddAliasRequest { +#pragma pack(push, 1) +typedef struct VixMsgAddAliasRequest { VixCommandRequestHeader header; uint32 options; @@ -1653,13 +1468,11 @@ struct VixMsgAddAliasRequest { /* char[] pemCert; */ /* char[] subjectName; */ /* char[] aliasComment; */ -} -#include "vmware_pack_end.h" -VixMsgAddAuthAliasRequest; +} VixMsgAddAuthAliasRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgRemoveAuthAliasRequest { +#pragma pack(push, 1) +typedef struct VixMsgRemoveAuthAliasRequest { VixCommandRequestHeader header; uint32 options; @@ -1676,13 +1489,11 @@ struct VixMsgRemoveAuthAliasRequest { /* char[] userName; */ /* char[] pemCert; */ /* char[] subjectName; */ -} -#include "vmware_pack_end.h" -VixMsgRemoveAuthAliasRequest; +} VixMsgRemoveAuthAliasRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgListAuthAliasesRequest { +#pragma pack(push, 1) +typedef struct VixMsgListAuthAliasesRequest { VixCommandRequestHeader header; uint32 options; @@ -1690,26 +1501,22 @@ struct VixMsgListAuthAliasesRequest { uint32 userNameLen; /* char[] userName; */ -} -#include "vmware_pack_end.h" -VixMsgListAuthAliasesRequest; +} VixMsgListAuthAliasesRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgListMappedAliasesRequest { +#pragma pack(push, 1) +typedef struct VixMsgListMappedAliasesRequest { VixCommandRequestHeader header; uint32 options; -} -#include "vmware_pack_end.h" -VixMsgListMappedAliasesRequest; +} VixMsgListMappedAliasesRequest; +#pragma pack(pop) /* * Windows Registry Management Support. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgCreateRegKeyRequest { +#pragma pack(push, 1) +typedef struct VixMsgCreateRegKeyRequest { VixCommandRequestHeader header; uint32 options; @@ -1724,13 +1531,11 @@ struct VixMsgCreateRegKeyRequest { * char[] path; * char[] classType; */ -} -#include "vmware_pack_end.h" -VixMsgCreateRegKeyRequest; +} VixMsgCreateRegKeyRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgListRegKeysRequest { +#pragma pack(push, 1) +typedef struct VixMsgListRegKeysRequest { VixCommandRequestHeader header; uint32 options; @@ -1757,13 +1562,11 @@ struct VixMsgListRegKeysRequest { * char[] path; * char[] matchPattern; */ -} -#include "vmware_pack_end.h" -VixMsgListRegKeysRequest; +} VixMsgListRegKeysRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgDeleteRegKeyRequest { +#pragma pack(push, 1) +typedef struct VixMsgDeleteRegKeyRequest { VixCommandRequestHeader header; uint32 options; @@ -1776,13 +1579,11 @@ struct VixMsgDeleteRegKeyRequest { * Followed by NUL-terminated string arguments. * char[] path; */ -} -#include "vmware_pack_end.h" -VixMsgDeleteRegKeyRequest; +} VixMsgDeleteRegKeyRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgSetRegValueRequest { +#pragma pack(push, 1) +typedef struct VixMsgSetRegValueRequest { VixCommandRequestHeader header; uint32 options; @@ -1802,13 +1603,11 @@ struct VixMsgSetRegValueRequest { * containing information of specified type. * void *dataBlob; */ -} -#include "vmware_pack_end.h" -VixMsgSetRegValueRequest; +} VixMsgSetRegValueRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgListRegValuesRequest { +#pragma pack(push, 1) +typedef struct VixMsgListRegValuesRequest { VixCommandRequestHeader header; uint32 options; @@ -1835,13 +1634,11 @@ struct VixMsgListRegValuesRequest { * char[] path; * char[] matchPattern; */ -} -#include "vmware_pack_end.h" -VixMsgListRegValuesRequest; +} VixMsgListRegValuesRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgDeleteRegValueRequest { +#pragma pack(push, 1) +typedef struct VixMsgDeleteRegValueRequest { VixCommandRequestHeader header; uint32 options; @@ -1855,9 +1652,8 @@ struct VixMsgDeleteRegValueRequest { * char[] path; * char[] name; */ -} -#include "vmware_pack_end.h" -VixMsgDeleteRegValueRequest; +} VixMsgDeleteRegValueRequest; +#pragma pack(pop) /* @@ -1880,27 +1676,23 @@ VixMsgDeleteRegValueRequest; * Sample Command. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgSampleCommandRequest { +#pragma pack(push, 1) +typedef struct VixMsgSampleCommandRequest { VixCommandRequestHeader header; int32 intArg; uint32 strArgLength; -} -#include "vmware_pack_end.h" -VixMsgSampleCommandRequest; +} VixMsgSampleCommandRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgSampleCommandResponse { +#pragma pack(push, 1) +typedef struct VixMsgSampleCommandResponse { VixCommandResponseHeader header; int32 intResult; uint32 strResultLength; -} -#include "vmware_pack_end.h" -VixMsgSampleCommandResponse; +} VixMsgSampleCommandResponse; +#pragma pack(pop) // End of "HOWTO: Adding a new Vix Command. Step 3." @@ -1910,81 +1702,67 @@ VixMsgSampleCommandResponse; * Debugger related commands. */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgAttachDebuggerRequest { +#pragma pack(push, 1) +typedef struct VixMsgAttachDebuggerRequest { VixCommandRequestHeader header; int32 options; uint32 propertyListBufferSize; -} -#include "vmware_pack_end.h" -VixMsgAttachDebuggerRequest; +} VixMsgAttachDebuggerRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgAttachDebuggerResponse { +#pragma pack(push, 1) +typedef struct VixMsgAttachDebuggerResponse { VixCommandResponseHeader header; uint32 propertyListBufferSize; -} -#include "vmware_pack_end.h" -VixMsgAttachDebuggerResponse; +} VixMsgAttachDebuggerResponse; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgIssueDebuggerCommandRequest { +#pragma pack(push, 1) +typedef struct VixMsgIssueDebuggerCommandRequest { VixCommandRequestHeader header; int32 options; uint32 propertyListBufferSize; uint32 debuggerBlobBufferSize; -} -#include "vmware_pack_end.h" -VixMsgIssueDebuggerCommandRequest; +} VixMsgIssueDebuggerCommandRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgIssueDebuggerCommandResponse { +#pragma pack(push, 1) +typedef struct VixMsgIssueDebuggerCommandResponse { VixCommandResponseHeader header; uint32 propertyListBufferSize; uint32 debuggerBlobBufferSize; -} -#include "vmware_pack_end.h" -VixMsgIssueDebuggerCommandResponse; +} VixMsgIssueDebuggerCommandResponse; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgDetachDebuggerRequest { +#pragma pack(push, 1) +typedef struct VixMsgDetachDebuggerRequest { VixCommandRequestHeader header; int32 options; uint32 propertyListBufferSize; -} -#include "vmware_pack_end.h" -VixMsgDetachDebuggerRequest; +} VixMsgDetachDebuggerRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgDetachDebuggerResponse { +#pragma pack(push, 1) +typedef struct VixMsgDetachDebuggerResponse { VixCommandResponseHeader header; uint32 propertyListBufferSize; -} -#include "vmware_pack_end.h" -VixMsgDetachDebuggerResponse; +} VixMsgDetachDebuggerResponse; +#pragma pack(pop) /* * ********************************************************** * VM Pause state change event format */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgPauseStateChangedEvent { +#pragma pack(push, 1) +typedef struct VixMsgPauseStateChangedEvent { VixMsgEventHeader eventHeader; Bool paused; -} -#include "vmware_pack_end.h" -VixMsgPauseStateChangedEvent; +} VixMsgPauseStateChangedEvent; +#pragma pack(pop) /* @@ -1997,9 +1775,8 @@ VixMsgPauseStateChangedEvent; * VIX_COMMAND_WAIT_FOR_USER_ACTION_IN_GUEST */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgWaitForUserActionRequest { +#pragma pack(push, 1) +typedef struct VixMsgWaitForUserActionRequest { VixCommandRequestHeader header; int32 userType; @@ -2014,23 +1791,20 @@ struct VixMsgWaitForUserActionRequest { // This is followed by: // userName // buffer of serialized properties -} -#include "vmware_pack_end.h" -VixMsgWaitForUserActionRequest; +} VixMsgWaitForUserActionRequest; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct VixMsgWaitForUserActionResponse { +#pragma pack(push, 1) +typedef struct VixMsgWaitForUserActionResponse { VixCommandRequestHeader header; Bool actionHappened; uint32 bufferSize; // This is followed by the buffer of serialized properties -} -#include "vmware_pack_end.h" -VixMsgWaitForUserActionResponse; +} VixMsgWaitForUserActionResponse; +#pragma pack(pop) /* @@ -2038,31 +1812,27 @@ VixMsgWaitForUserActionResponse; * List filesystems */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandListFileSystemsRequest { +#pragma pack(push, 1) +typedef struct VixCommandListFileSystemsRequest { VixCommandRequestHeader header; uint32 options; uint32 propertyListSize; -} -#include "vmware_pack_end.h" -VixCommandListFileSystemsRequest; +} VixCommandListFileSystemsRequest; +#pragma pack(pop) /* * ********************************************************** * Acquire Credentials. */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandAcquireCredentialsRequest { +#pragma pack(push, 1) +typedef struct VixCommandAcquireCredentialsRequest { VixCommandRequestHeader header; int64 sessionID; -} -#include "vmware_pack_end.h" -VixCommandAcquireCredentialsRequest; +} VixCommandAcquireCredentialsRequest; +#pragma pack(pop) /* * ********************************************************** @@ -2070,17 +1840,15 @@ VixCommandAcquireCredentialsRequest; * property list. */ -typedef -#include "vmware_pack_begin.h" -struct VixCommandGenericRequest { +#pragma pack(push, 1) +typedef struct VixCommandGenericRequest { VixCommandRequestHeader header; uint32 options; uint32 propertyListSize; // This is followed by the buffer of serialized properties -} -#include "vmware_pack_end.h" -VixCommandGenericRequest; +} VixCommandGenericRequest; +#pragma pack(pop) /* * The security classifications for async op types/op code. Each op code diff --git a/open-vm-tools/lib/include/vixOpenSource.h b/open-vm-tools/lib/include/vixOpenSource.h index 6f3b2079d..8897bd6d8 100644 --- a/open-vm-tools/lib/include/vixOpenSource.h +++ b/open-vm-tools/lib/include/vixOpenSource.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2020 VMware, Inc. All rights reserved. + * Copyright (C) 2007-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -107,18 +107,16 @@ VixError Vix_TranslateGuestRegistryError(int systemError); * enum constant, like an integer. For example, err = VIX_E_FAIL; works. * This just leaves the flags and extraError fields as 0. */ -typedef -#include "vmware_pack_begin.h" -struct VixErrorFields { +#pragma pack(push, 1) +typedef struct VixErrorFields { uint16 error; uint8 flags; uint8 extraErrorType; uint32 extraError; -} -#include "vmware_pack_end.h" -VixErrorFields; +} VixErrorFields; +#pragma pack(pop) /* * These are the flags for a Vix error. diff --git a/open-vm-tools/libguestlib/vmGuestLibInt.h b/open-vm-tools/libguestlib/vmGuestLibInt.h index 4223d9239..028ca5039 100644 --- a/open-vm-tools/libguestlib/vmGuestLibInt.h +++ b/open-vm-tools/libguestlib/vmGuestLibInt.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2017 VMware, Inc. All rights reserved. + * Copyright (C) 2003-2017,2020-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -58,15 +58,13 @@ typedef struct { * padding, adding the 3-byte "padding" field and using pack(1) * to make sure we always have 4-byte alignment. */ -typedef -#include "vmware_pack_begin.h" -struct { +#pragma pack(push, 1) +typedef struct { Bool valid; // Indicates whether this stat is valid on this system uint8 padding[3]; uint64 value; // Actual stat value. -} -#include "vmware_pack_end.h" -StatUint64; +} StatUint64; +#pragma pack(pop) @@ -76,9 +74,8 @@ StatUint64; */ #if 0 -typedef -#include "vmware_pack_begin.h" -struct VMGuestLibDataV1 { +#pragma pack(push, 1) +typedef struct VMGuestLibDataV1 { uint32 version; VMSessionId sessionId; @@ -112,20 +109,17 @@ struct VMGuestLibDataV1 { * as big as SCHED_GROUP_PATHNAME_LEN. */ char resourcePoolPath[512]; -} -#include "vmware_pack_end.h" -VMGuestLibDataV1; +} VMGuestLibDataV1; +#pragma pack(pop) #endif // #if 0 -typedef -#include "vmware_pack_begin.h" -struct { +#pragma pack(push, 1) +typedef struct { uint32 version; VMSessionId sessionId; -} -#include "vmware_pack_end.h" -VMGuestLibHeader; +} VMGuestLibHeader; +#pragma pack(pop) /* * This is version 2 of the data structure GuestLib uses to obtain @@ -133,9 +127,8 @@ VMGuestLibHeader; * exposed to users of the GuestLib API. */ -typedef -#include "vmware_pack_begin.h" -struct VMGuestLibDataV2 { +#pragma pack(push, 1) +typedef struct VMGuestLibDataV2 { /* Header */ VMGuestLibHeader hdr; @@ -175,9 +168,8 @@ struct VMGuestLibDataV2 { Bool valid; char value[512]; } resourcePoolPath; -} -#include "vmware_pack_end.h" -VMGuestLibDataV2; +} VMGuestLibDataV2; +#pragma pack(pop) /* @@ -199,18 +191,16 @@ VMGuestLibDataV2; * supported by the host. */ -typedef -#include "vmware_pack_begin.h" -struct VMGuestLibDataV3 { +#pragma pack(push, 1) +typedef struct VMGuestLibDataV3 { /* Header */ VMGuestLibHeader hdr; /* Statistics */ uint32 dataSize; char data[0]; -} -#include "vmware_pack_end.h" -VMGuestLibDataV3; +} VMGuestLibDataV3; +#pragma pack(pop) #if defined(__cplusplus) } // extern "C" diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dnd.h b/open-vm-tools/services/plugins/dndcp/dnd/dnd.h index bc6636d11..a1bcbb0ff 100644 --- a/open-vm-tools/services/plugins/dndcp/dnd/dnd.h +++ b/open-vm-tools/services/plugins/dndcp/dnd/dnd.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2005-2020 VMware, Inc. All rights reserved. + * Copyright (C) 2005-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -38,14 +38,6 @@ #include "unicodeTypes.h" #include "dynarray.h" -/* - * TODO: this works around a compilation issue, and can be removed - * when this file is converted to pack pragmas (after FreeBSD/Tools - * build is removed). --kevinc - */ -#ifdef _MSC_VER -# pragma warning(disable:4103) -#endif #if defined(__cplusplus) extern "C" { @@ -190,18 +182,16 @@ typedef enum DND_TRANSPORT_PACKET_TYPE_PAYLOAD, } DND_TRANSPORT_PACKET_TYPE; -typedef -#include "vmware_pack_begin.h" -struct DnDTransportPacketHeader { +#pragma pack(push, 1) +typedef struct DnDTransportPacketHeader { uint32 type; uint32 seqNum; uint32 totalSize; uint32 payloadSize; uint32 offset; uint8 payload[1]; -} -#include "vmware_pack_end.h" -DnDTransportPacketHeader; +} DnDTransportPacketHeader; +#pragma pack(pop) typedef struct DnDTransportBuffer { size_t seqNum; diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.h b/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.h index 556e592c9..8be9fdb84 100644 --- a/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.h +++ b/open-vm-tools/services/plugins/dndcp/dnd/dndCPMsgV4.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2010-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -193,9 +193,8 @@ typedef enum DnDCPMsgPacketType { * Header definition for DnD version 4 packet. Any DnD version 4 packet has 2 * parts: fixed header and payload. payload is optional. */ -typedef -#include "vmware_pack_begin.h" -struct DnDCPMsgHdrV4 { +#pragma pack(push, 1) +typedef struct DnDCPMsgHdrV4 { uint32 cmd; /* DnD/CP message command. */ uint32 type; /* DnD/CP message type. */ uint32 src; /* Message sender. */ @@ -210,9 +209,8 @@ struct DnDCPMsgHdrV4 { uint32 binarySize; /* Binary size. */ uint32 payloadOffset; /* Payload offset. */ uint32 payloadSize; /* Payload size. */ -} -#include "vmware_pack_end.h" -DnDCPMsgHdrV4; +} DnDCPMsgHdrV4; +#pragma pack(pop) /* Some important definitions for DnDCPMsgV4. */ #define DND_CP_MSG_HEADERSIZE_V4 (sizeof (DnDCPMsgHdrV4)) diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndClipboard.h b/open-vm-tools/services/plugins/dndcp/dnd/dndClipboard.h index 2090caae7..dfe2de217 100644 --- a/open-vm-tools/services/plugins/dndcp/dnd/dndClipboard.h +++ b/open-vm-tools/services/plugins/dndcp/dnd/dndClipboard.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2007-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2007-2021 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -52,50 +52,42 @@ extern "C" { #define CPCLIPITEM_MAX_SIZE_V3 (DNDMSG_MAX_ARGSZ - 100) /* Cross platform formats */ -typedef -#include "vmware_pack_begin.h" -struct CPFileList { +#pragma pack(push, 1) +typedef struct CPFileList { uint64 fileSize; uint32 relPathsLen; uint32 fulPathsLen; uint8 filelists[1]; -} -#include "vmware_pack_end.h" -CPFileList; +} CPFileList; +#pragma pack(pop) #define CPFILELIST_HEADER_SIZE (1* sizeof(uint64) + 2 * sizeof(uint32)) -typedef -#include "vmware_pack_begin.h" -struct UriFileList { +#pragma pack(push, 1) +typedef struct UriFileList { uint64 fileSize; uint32 uriPathsLen; uint8 filelists[1]; -} -#include "vmware_pack_end.h" -UriFileList; +} UriFileList; +#pragma pack(pop) #define URI_FILELIST_HEADER_SIZE (1* sizeof(uint64) + 1 * sizeof(uint32)) -typedef -#include "vmware_pack_begin.h" -struct CPFileAttributes { +#pragma pack(push, 1) +typedef struct CPFileAttributes { // File, Directory, or link. See HgfsFileType. uint64 fileType; // Read, write, execute permissions. See File_GetFilePermissions(). uint64 filePermissions; -} -#include "vmware_pack_end.h" -CPFileAttributes; +} CPFileAttributes; +#pragma pack(pop) -typedef -#include "vmware_pack_begin.h" -struct CPAttributeList { +#pragma pack(push, 1) +typedef struct CPAttributeList { uint32 attributesLen; CPFileAttributes attributeList[1]; -} -#include "vmware_pack_end.h" -CPAttributeList; +} CPAttributeList; +#pragma pack(pop) #define URI_ATTRIBUTES_LIST_HEADER_SIZE (1* sizeof(uint32))