1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* |
4 |
|
|
* This program and the accompanying materials are made available under the |
5 |
|
|
* terms of the MIT License which is available at |
6 |
|
|
* https://opensource.org/licenses/MIT. |
7 |
|
|
* |
8 |
|
|
* SPDX-License-Identifier: MIT |
9 |
|
|
**************************************************************************/ |
10 |
|
|
|
11 |
|
|
|
12 |
|
|
/**************************************************************************/ |
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/** */ |
15 |
|
|
/** FileX Component */ |
16 |
|
|
/** */ |
17 |
|
|
/** Utility */ |
18 |
|
|
/** */ |
19 |
|
|
/**************************************************************************/ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define FX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "fx_api.h" |
28 |
|
|
#include "fx_system.h" |
29 |
|
|
#include "fx_utility.h" |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
/**************************************************************************/ |
33 |
|
|
/* */ |
34 |
|
|
/* FUNCTION RELEASE */ |
35 |
|
|
/* */ |
36 |
|
|
/* _fx_utility_32_unsigned_read PORTABLE C */ |
37 |
|
|
/* 6.1 */ |
38 |
|
|
/* AUTHOR */ |
39 |
|
|
/* */ |
40 |
|
|
/* William E. Lamie, Microsoft Corporation */ |
41 |
|
|
/* */ |
42 |
|
|
/* DESCRIPTION */ |
43 |
|
|
/* */ |
44 |
|
|
/* This function reads (with endian awareness) a 32-bit unsigned data */ |
45 |
|
|
/* from the specified source and returns the value to the caller. */ |
46 |
|
|
/* */ |
47 |
|
|
/* INPUT */ |
48 |
|
|
/* */ |
49 |
|
|
/* source_ptr Source memory pointer */ |
50 |
|
|
/* */ |
51 |
|
|
/* OUTPUT */ |
52 |
|
|
/* */ |
53 |
|
|
/* ULONG value */ |
54 |
|
|
/* */ |
55 |
|
|
/* CALLS */ |
56 |
|
|
/* */ |
57 |
|
|
/* None */ |
58 |
|
|
/* */ |
59 |
|
|
/* CALLED BY */ |
60 |
|
|
/* */ |
61 |
|
|
/* FileX System Functions */ |
62 |
|
|
/* */ |
63 |
|
|
/* RELEASE HISTORY */ |
64 |
|
|
/* */ |
65 |
|
|
/* DATE NAME DESCRIPTION */ |
66 |
|
|
/* */ |
67 |
|
|
/* 05-19-2020 William E. Lamie Initial Version 6.0 */ |
68 |
|
|
/* 09-30-2020 William E. Lamie Modified comment(s), */ |
69 |
|
|
/* resulting in version 6.1 */ |
70 |
|
|
/* */ |
71 |
|
|
/**************************************************************************/ |
72 |
|
3054664 |
ULONG _fx_utility_32_unsigned_read(UCHAR *source_ptr) |
73 |
|
|
{ |
74 |
|
|
|
75 |
|
|
ULONG value; |
76 |
|
|
|
77 |
|
|
/* Pickup the UINT from the destination with endian-awareness. */ |
78 |
|
3054664 |
value = ((((ULONG) *(source_ptr+3)) & 0xFF) << 24) | |
79 |
|
3054664 |
((((ULONG) *(source_ptr+2)) & 0xFF) << 16) | |
80 |
|
3054664 |
((((ULONG) *(source_ptr+1)) & 0xFF) << 8) | |
81 |
|
3054664 |
(((ULONG) *(source_ptr)) & 0xFF); |
82 |
|
|
|
83 |
|
|
/* Return value to caller. */ |
84 |
|
3054664 |
return(value); |
85 |
|
|
} |
86 |
|
|
|