diff options
author | midipix <writeonce@midipix.org> | 2018-03-16 23:15:24 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-03-20 23:27:57 -0400 |
commit | a738157be0ea0c08564aadf6f59df5f3702ce8ce (patch) | |
tree | 04b9b83f616397e4cd49610142c92976f8453006 /src/fs | |
parent | 12d3bfc13a7b31e68b54619b526817d92b033a27 (diff) | |
download | ntapi-a738157be0ea0c08564aadf6f59df5f3702ce8ce.tar.bz2 ntapi-a738157be0ea0c08564aadf6f59df5f3702ce8ce.tar.xz |
code maintenance: incorporate use of the __offsetof convenience macro.
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/ntapi_tt_mount.c | 4 | ||||
-rw-r--r-- | src/fs/ntapi_tt_stat.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/fs/ntapi_tt_mount.c b/src/fs/ntapi_tt_mount.c index f5ae113..448841e 100644 --- a/src/fs/ntapi_tt_mount.c +++ b/src/fs/ntapi_tt_mount.c @@ -105,7 +105,7 @@ static int32_t __stdcall __tt_get_dos_drive_device_or_root_handle( else return NT_STATUS_INVALID_PARAMETER_2; - dos_name.strlen = ((size_t)(&((_dos_name_buffer *)0)->root)); + dos_name.strlen = __offsetof(_dos_name_buffer,root); dos_name.maxlen = 0; dos_name.buffer = &(dos_name_buffer.global_prefix[0]); @@ -232,7 +232,7 @@ int32_t __stdcall __ntapi_tt_get_dos_drive_mount_points( dev_mount_point->symlink_name_length = 0; dev_mount_point->unique_id_offset = 0; dev_mount_point->unique_id_length = 0; - dev_mount_point->device_name_offset = ((size_t)(&((nt_mount_point_param *)0)->device_name)); + dev_mount_point->device_name_offset = __offsetof(nt_mount_point_param,device_name); dev_mount_point->device_name_length = dev_name->name_length; dev_mount_point->mount_points_offset = 0; diff --git a/src/fs/ntapi_tt_stat.c b/src/fs/ntapi_tt_stat.c index cab84c3..088adf6 100644 --- a/src/fs/ntapi_tt_stat.c +++ b/src/fs/ntapi_tt_stat.c @@ -56,7 +56,7 @@ int32_t __stdcall __ntapi_tt_stat( __ntapi->tt_aligned_block_memcpy( (uintptr_t *)stat, (uintptr_t *)buffer, - ((size_t)(&((nt_fai *)0)->name_info))); + __offsetof(nt_fai,name_info)); /* record volume-relative file name length */ fai = (nt_fai *)buffer; |