/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** FileX Component */ /** */ /** Utility */ /** */ /**************************************************************************/ /**************************************************************************/ #define FX_SOURCE_CODE /* Include necessary system files. */ #include "fx_api.h" #include "fx_system.h" #include "fx_utility.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _fx_utility_32_unsigned_write PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function writes (with endian awareness) a 32-bit unsigned data */ /* type to the specified destination. */ /* */ /* INPUT */ /* */ /* dest_ptr Destination memory pointer */ /* value Value to write to memory */ /* */ /* OUTPUT */ /* */ /* None */ /* */ /* CALLS */ /* */ /* None */ /* */ /* CALLED BY */ /* */ /* FileX System Functions */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 William E. Lamie Initial Version 6.0 */ /* 09-30-2020 William E. Lamie Modified comment(s), */ /* resulting in version 6.1 */ /* */ /**************************************************************************/ VOID _fx_utility_32_unsigned_write(UCHAR *dest_ptr, ULONG value) { /* Store the UINT into the destination with endian-awareness. */ *(dest_ptr) = (UCHAR)(value & 0xFF); *(dest_ptr + 1) = (UCHAR)((value >> 8) & 0xFF); *(dest_ptr + 2) = (UCHAR)((value >> 16) & 0xFF); *(dest_ptr + 3) = (UCHAR)((value >> 24) & 0xFF); }