GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_system_version_string_get.c Lines: 9 9 100.0 %
Date: 2024-12-05 08:52:37 Branches: 2 2 100.0 %

Line Branch Exec Source
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
/** GUIX Component                                                        */
16
/**                                                                       */
17
/**   System Management (System)                                          */
18
/**                                                                       */
19
/**************************************************************************/
20
21
#define GX_SOURCE_CODE
22
23
24
/* Include necessary system files.  */
25
26
#include "gx_api.h"
27
#include "gx_system.h"
28
#include "gx_utility.h"
29
30
/**************************************************************************/
31
/*                                                                        */
32
/*  FUNCTION                                               RELEASE        */
33
/*                                                                        */
34
/*    _gx_system_version_string_get                       PORTABLE C      */
35
/*                                                           6.1          */
36
/*  AUTHOR                                                                */
37
/*                                                                        */
38
/*    Kenneth Maxwell, Microsoft Corporation                              */
39
/*                                                                        */
40
/*  DESCRIPTION (deprecated)                                              */
41
/*                                                                        */
42
/*    This service retrives system version string.                        */
43
/*                                                                        */
44
/*  INPUT                                                                 */
45
/*                                                                        */
46
/*    return_string                         Pointer to return string      */
47
/*                                            pointer                     */
48
/*                                                                        */
49
/*  OUTPUT                                                                */
50
/*                                                                        */
51
/*    status                                Completion status             */
52
/*                                                                        */
53
/*  CALLS                                                                 */
54
/*                                                                        */
55
/*    None                                                                */
56
/*                                                                        */
57
/*  CALLED BY                                                             */
58
/*                                                                        */
59
/*    Application Code                                                    */
60
/*                                                                        */
61
/*  RELEASE HISTORY                                                       */
62
/*                                                                        */
63
/*    DATE              NAME                      DESCRIPTION             */
64
/*                                                                        */
65
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
66
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
67
/*                                            resulting in version 6.1    */
68
/*                                                                        */
69
/**************************************************************************/
70
#if defined(GX_ENABLE_DEPRECATED_STRING_API)
71
1
UINT  _gx_system_version_string_get(GX_CHAR **return_string)
72
{
73
1
    *return_string = _gx_system_version_string;
74
1
    return(GX_SUCCESS);
75
}
76
#endif
77
78
/**************************************************************************/
79
/*                                                                        */
80
/*  FUNCTION                                               RELEASE        */
81
/*                                                                        */
82
/*    _gx_system_version_string_get_ext                   PORTABLE C      */
83
/*                                                           6.1          */
84
/*  AUTHOR                                                                */
85
/*                                                                        */
86
/*    Kenneth Maxwell, Microsoft Corporation                              */
87
/*                                                                        */
88
/*  DESCRIPTION (deprecated)                                              */
89
/*                                                                        */
90
/*    This service retrieves system version string.                       */
91
/*                                                                        */
92
/*  INPUT                                                                 */
93
/*                                                                        */
94
/*    return_string                         Pointer to return string      */
95
/*                                            pointer                     */
96
/*                                                                        */
97
/*  OUTPUT                                                                */
98
/*                                                                        */
99
/*    status                                Completion status             */
100
/*                                                                        */
101
/*  CALLS                                                                 */
102
/*                                                                        */
103
/*    None                                                                */
104
/*                                                                        */
105
/*  CALLED BY                                                             */
106
/*                                                                        */
107
/*    Application Code                                                    */
108
/*                                                                        */
109
/*  RELEASE HISTORY                                                       */
110
/*                                                                        */
111
/*    DATE              NAME                      DESCRIPTION             */
112
/*                                                                        */
113
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
114
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
115
/*                                            resulting in version 6.1    */
116
/*                                                                        */
117
/**************************************************************************/
118
2
UINT  _gx_system_version_string_get_ext(GX_STRING *return_string)
119
{
120
UINT string_length;
121
UINT status;
122
123
2
    status = _gx_utility_string_length_check(_gx_system_version_string, &string_length, sizeof(_gx_system_version_string) - 1);
124
125
2
    if (status == GX_SUCCESS)
126
    {
127
1
        return_string -> gx_string_ptr = _gx_system_version_string;
128
1
        return_string -> gx_string_length =  string_length;
129
    }
130
2
    return status;
131
}