C
Chris Saunders
Here is the declaration of a struct from WinIoCtl.h:
//
// Structures for FSCTL_TXFS_READ_BACKUP_INFORMATION
//
typedef struct _TXFS_READ_BACKUP_INFORMATION_OUT {
union {
//
// Used to return the required buffer size if return code is
STATUS_BUFFER_OVERFLOW
//
DWORD BufferLength;
//
// On success the data is copied here.
//
BYTE Buffer[1];
} DUMMYUNIONNAME;
} TXFS_READ_BACKUP_INFORMATION_OUT, *PTXFS_READ_BACKUP_INFORMATION_OUT;
Now Buffer can be various lengths and I know of only one way to allocate
memory for it (by allocating memory for the whole struct). I have seen
other similar structs that are not a union and have multiple arrays with a
similar declaration. Is there any way to allocate memory for such arrays?
Regards
Chris Saunders
//
// Structures for FSCTL_TXFS_READ_BACKUP_INFORMATION
//
typedef struct _TXFS_READ_BACKUP_INFORMATION_OUT {
union {
//
// Used to return the required buffer size if return code is
STATUS_BUFFER_OVERFLOW
//
DWORD BufferLength;
//
// On success the data is copied here.
//
BYTE Buffer[1];
} DUMMYUNIONNAME;
} TXFS_READ_BACKUP_INFORMATION_OUT, *PTXFS_READ_BACKUP_INFORMATION_OUT;
Now Buffer can be various lengths and I know of only one way to allocate
memory for it (by allocating memory for the whole struct). I have seen
other similar structs that are not a union and have multiple arrays with a
similar declaration. Is there any way to allocate memory for such arrays?
Regards
Chris Saunders