1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors |
4 |
|
|
* |
5 |
|
|
* This program and the accompanying materials are made available under the |
6 |
|
|
* terms of the MIT License which is available at |
7 |
|
|
* https://opensource.org/licenses/MIT. |
8 |
|
|
* |
9 |
|
|
* SPDX-License-Identifier: MIT |
10 |
|
|
**************************************************************************/ |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/**************************************************************************/ |
15 |
|
|
/** */ |
16 |
|
|
/** GUIX Component */ |
17 |
|
|
/** */ |
18 |
|
|
/** Binres Loader Management (Binres Loader) */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
|
22 |
|
|
#define GX_SOURCE_CODE |
23 |
|
|
|
24 |
|
|
|
25 |
|
|
/* Include necessary system files. */ |
26 |
|
|
|
27 |
|
|
#include "gx_api.h" |
28 |
|
|
#include "gx_binres_loader.h" |
29 |
|
|
#include "gx_system.h" |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
/**************************************************************************/ |
33 |
|
|
/* */ |
34 |
|
|
/* FUNCTION RELEASE */ |
35 |
|
|
/* */ |
36 |
|
|
/* _gxe_binres_language_table_load PORTABLE C */ |
37 |
|
|
/* 6.1 */ |
38 |
|
|
/* AUTHOR */ |
39 |
|
|
/* */ |
40 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
41 |
|
|
/* */ |
42 |
|
|
/* DESCRIPTION */ |
43 |
|
|
/* */ |
44 |
|
|
/* This function checks for errors in binres language table load */ |
45 |
|
|
/* function. */ |
46 |
|
|
/* */ |
47 |
|
|
/* INPUT */ |
48 |
|
|
/* */ |
49 |
|
|
/* root_address Root address of binary */ |
50 |
|
|
/* resource data */ |
51 |
|
|
/* returned_language_table Pointer to loaded language */ |
52 |
|
|
/* table */ |
53 |
|
|
/* */ |
54 |
|
|
/* OUTPUT */ |
55 |
|
|
/* */ |
56 |
|
|
/* status Completion status */ |
57 |
|
|
/* */ |
58 |
|
|
/* CALLS */ |
59 |
|
|
/* */ |
60 |
|
|
/* _gx_binres_language_table_load The actual binres language */ |
61 |
|
|
/* table load function */ |
62 |
|
|
/* */ |
63 |
|
|
/* CALLED BY */ |
64 |
|
|
/* */ |
65 |
|
|
/* Application Code */ |
66 |
|
|
/* */ |
67 |
|
|
/**************************************************************************/ |
68 |
|
|
#ifdef GX_BINARY_RESOURCE_SUPPORT |
69 |
|
|
#ifdef GX_ENABLE_DEPRECATED_STRING_API |
70 |
|
17 |
UINT _gxe_binres_language_table_load(GX_UBYTE *root_address, GX_UBYTE ****returned_language_table) |
71 |
|
|
{ |
72 |
|
|
UINT status; |
73 |
|
|
|
74 |
✓✓✓✓
|
17 |
if ((root_address == GX_NULL) || (returned_language_table == GX_NULL)) |
75 |
|
|
{ |
76 |
|
3 |
return GX_PTR_ERROR; |
77 |
|
|
} |
78 |
|
|
|
79 |
✓✓ |
14 |
if ((_gx_system_memory_allocator == GX_NULL) || |
80 |
✓✓ |
13 |
(_gx_system_memory_free == GX_NULL)) |
81 |
|
|
{ |
82 |
|
2 |
return GX_SYSTEM_MEMORY_ERROR; |
83 |
|
|
} |
84 |
|
|
|
85 |
|
12 |
status = _gx_binres_language_table_load(root_address, returned_language_table); |
86 |
|
|
|
87 |
|
|
/* Return completion status code. */ |
88 |
|
12 |
return(status); |
89 |
|
|
} |
90 |
|
|
#endif |
91 |
|
|
#endif |
92 |
|
|
|
93 |
|
|
/**************************************************************************/ |
94 |
|
|
/* */ |
95 |
|
|
/* FUNCTION RELEASE */ |
96 |
|
|
/* */ |
97 |
|
|
/* _gxe_binres_language_table_load_ext PORTABLE C */ |
98 |
|
|
/* 6.1 */ |
99 |
|
|
/* AUTHOR */ |
100 |
|
|
/* */ |
101 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
102 |
|
|
/* */ |
103 |
|
|
/* DESCRIPTION */ |
104 |
|
|
/* */ |
105 |
|
|
/* This function checks for errors in binres language table load */ |
106 |
|
|
/* function. */ |
107 |
|
|
/* */ |
108 |
|
|
/* INPUT */ |
109 |
|
|
/* */ |
110 |
|
|
/* root_address Root address of binary */ |
111 |
|
|
/* resource data */ |
112 |
|
|
/* returned_language_table Pointer to loaded language */ |
113 |
|
|
/* table */ |
114 |
|
|
/* */ |
115 |
|
|
/* OUTPUT */ |
116 |
|
|
/* */ |
117 |
|
|
/* status Completion status */ |
118 |
|
|
/* */ |
119 |
|
|
/* CALLS */ |
120 |
|
|
/* */ |
121 |
|
|
/* _gx_binres_language_table_load_ext The actual binres language */ |
122 |
|
|
/* table load function */ |
123 |
|
|
/* */ |
124 |
|
|
/* CALLED BY */ |
125 |
|
|
/* */ |
126 |
|
|
/* Application Code */ |
127 |
|
|
/* */ |
128 |
|
|
/**************************************************************************/ |
129 |
|
|
#ifdef GX_BINARY_RESOURCE_SUPPORT |
130 |
|
38 |
UINT _gxe_binres_language_table_load_ext(GX_UBYTE *root_address, GX_STRING ***returned_language_table) |
131 |
|
|
{ |
132 |
|
|
UINT status; |
133 |
|
|
|
134 |
✓✓✓✓
|
38 |
if ((root_address == GX_NULL) || (returned_language_table == GX_NULL)) |
135 |
|
|
{ |
136 |
|
2 |
return GX_PTR_ERROR; |
137 |
|
|
} |
138 |
|
|
|
139 |
✓✓ |
36 |
if ((_gx_system_memory_allocator == GX_NULL) || |
140 |
✓✓ |
35 |
(_gx_system_memory_free == GX_NULL)) |
141 |
|
|
{ |
142 |
|
2 |
return GX_SYSTEM_MEMORY_ERROR; |
143 |
|
|
} |
144 |
|
|
|
145 |
|
34 |
status = _gx_binres_language_table_load_ext(root_address, returned_language_table); |
146 |
|
|
|
147 |
|
|
/* Return completion status code. */ |
148 |
|
34 |
return(status); |
149 |
|
|
} |
150 |
|
|
#endif |
151 |
|
|
|