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 /** ThreadX Component                                                     */
16 /**                                                                       */
17 /**   Module Manager                                                      */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 #define TX_SOURCE_CODE
23 
24 #include "txm_module.h"
25 #include "txm_module_manager_util.h"
26 
27 /**************************************************************************/
28 /*                                                                        */
29 /*  FUNCTION                                               RELEASE        */
30 /*                                                                        */
31 /*    _txm_module_manager_object_pointer_get              PORTABLE C      */
32 /*                                                           6.1          */
33 /*  AUTHOR                                                                */
34 /*                                                                        */
35 /*    Scott Larson, Microsoft Corporation                                 */
36 /*                                                                        */
37 /*  DESCRIPTION                                                           */
38 /*                                                                        */
39 /*    This function is deprecated and calls the secure version of this    */
40 /*    function (_txm_module_manager_object_pointer_get_extended) with the */
41 /*    maximum possible name length since none was passed.                 */
42 /*                                                                        */
43 /*  INPUT                                                                 */
44 /*                                                                        */
45 /*    object_type                       Type of object, as follows:       */
46 /*                                                                        */
47 /*                                          TXM_BLOCK_POOL_OBJECT         */
48 /*                                          TXM_BYTE_POOL_OBJECT          */
49 /*                                          TXM_EVENT_FLAGS_OBJECT        */
50 /*                                          TXM_MUTEX_OBJECT              */
51 /*                                          TXM_QUEUE_OBJECT              */
52 /*                                          TXM_SEMAPHORE_OBJECT          */
53 /*                                          TXM_THREAD_OBJECT             */
54 /*                                          TXM_TIMER_OBJECT              */
55 /*    name                              Name to search for                */
56 /*    object_ptr                        Pointer to the object             */
57 /*                                                                        */
58 /*  OUTPUT                                                                */
59 /*                                                                        */
60 /*    TX_SUCCESS                        Successful completion             */
61 /*    TX_PTR_ERROR                      Invalid name or object ptr        */
62 /*    TX_OPTION_ERROR                   Invalid option type               */
63 /*    TX_NO_INSTANCE                    Object not found                  */
64 /*                                                                        */
65 /*  CALLS                                                                 */
66 /*                                                                        */
67 /*    _txm_module_manager_object_pointer_get_extended                     */
68 /*                                      Secure version of this function   */
69 /*                                                                        */
70 /*  CALLED BY                                                             */
71 /*                                                                        */
72 /*    Application code                                                    */
73 /*                                                                        */
74 /*  RELEASE HISTORY                                                       */
75 /*                                                                        */
76 /*    DATE              NAME                      DESCRIPTION             */
77 /*                                                                        */
78 /*  09-30-2020      Scott Larson            Initial Version 6.1           */
79 /*                                                                        */
80 /**************************************************************************/
_txm_module_manager_object_pointer_get(UINT object_type,CHAR * name,VOID ** object_ptr)81 UINT  _txm_module_manager_object_pointer_get(UINT object_type, CHAR *name, VOID **object_ptr)
82 {
83 
84 UINT    status;
85 
86     /* Call the secure version of this function with the maximum length
87        possible since none was passed.  */
88     status =  _txm_module_manager_object_pointer_get_extended(object_type, name, TXM_MODULE_MANAGER_UTIL_MAX_VALUE_OF_TYPE_UNSIGNED(UINT), object_ptr);
89     return(status);
90 }
91