1. Import SnpNt32Dxe. That is a thunk driver could produce SNP protocol on NT32 platf...
[mirror_edk2.git] / Nt32Pkg / SnpNt32Dxe / ComponentName.c
1 /** @file
2
3 Copyright (c) 2006 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 ComponentName.c
15
16 Abstract:
17
18
19 **/
20
21 #include "SnpNt32.h"
22
23 //
24 // EFI Component Name Functions
25 //
26 EFI_STATUS
27 EFIAPI
28 SnpNt32DriverComponentNameGetDriverName (
29 IN EFI_COMPONENT_NAME_PROTOCOL *This,
30 IN CHAR8 *Language,
31 OUT CHAR16 **DriverName
32 );
33
34 EFI_STATUS
35 EFIAPI
36 SnpNt32DriverComponentNameGetControllerName (
37 IN EFI_COMPONENT_NAME_PROTOCOL *This,
38 IN EFI_HANDLE ControllerHandle,
39 IN EFI_HANDLE ChildHandle OPTIONAL,
40 IN CHAR8 *Language,
41 OUT CHAR16 **ControllerName
42 );
43
44 //
45 // EFI Component Name Protocol
46 //
47 EFI_COMPONENT_NAME_PROTOCOL gSnpNt32DriverComponentName = {
48 SnpNt32DriverComponentNameGetDriverName,
49 SnpNt32DriverComponentNameGetControllerName,
50 "eng"
51 };
52
53 static EFI_UNICODE_STRING_TABLE mSnpNt32DriverNameTable[] = {
54 {
55 "eng",
56 L"SNP NT32 Driver"
57 },
58 {
59 NULL,
60 NULL
61 }
62 };
63
64 EFI_STATUS
65 EFIAPI
66 SnpNt32DriverComponentNameGetDriverName (
67 IN EFI_COMPONENT_NAME_PROTOCOL *This,
68 IN CHAR8 *Language,
69 OUT CHAR16 **DriverName
70 )
71 /*++
72
73 Routine Description:
74 Retrieves a Unicode string that is the user readable name of the EFI Driver.
75
76 Arguments:
77 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
78 Language - A pointer to a three character ISO 639-2 language identifier.
79 This is the language of the driver name that that the caller
80 is requesting, and it must match one of the languages specified
81 in SupportedLanguages. The number of languages supported by a
82 driver is up to the driver writer.
83 DriverName - A pointer to the Unicode string to return. This Unicode string
84 is the name of the driver specified by This in the language
85 specified by Language.
86
87 Returns:
88 EFI_SUCCESS - The Unicode string for the Driver specified by This
89 and the language specified by Language was returned
90 in DriverName.
91 EFI_INVALID_PARAMETER - Language is NULL.
92 EFI_INVALID_PARAMETER - DriverName is NULL.
93 EFI_UNSUPPORTED - The driver specified by This does not support the
94 language specified by Language.
95
96 --*/
97 {
98 return LookupUnicodeString (
99 Language,
100 gSnpNt32DriverComponentName.SupportedLanguages,
101 mSnpNt32DriverNameTable,
102 DriverName
103 );
104 }
105
106 EFI_STATUS
107 EFIAPI
108 SnpNt32DriverComponentNameGetControllerName (
109 IN EFI_COMPONENT_NAME_PROTOCOL *This,
110 IN EFI_HANDLE ControllerHandle,
111 IN EFI_HANDLE ChildHandle OPTIONAL,
112 IN CHAR8 *Language,
113 OUT CHAR16 **ControllerName
114 )
115 /*++
116
117 Routine Description:
118 Retrieves a Unicode string that is the user readable name of the controller
119 that is being managed by an EFI Driver.
120
121 Arguments:
122 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
123 ControllerHandle - The handle of a controller that the driver specified by
124 This is managing. This handle specifies the controller
125 whose name is to be returned.
126 ChildHandle - The handle of the child controller to retrieve the name
127 of. This is an optional parameter that may be NULL. It
128 will be NULL for device drivers. It will also be NULL
129 for a bus drivers that wish to retrieve the name of the
130 bus controller. It will not be NULL for a bus driver
131 that wishes to retrieve the name of a child controller.
132 Language - A pointer to a three character ISO 639-2 language
133 identifier. This is the language of the controller name
134 that that the caller is requesting, and it must match one
135 of the languages specified in SupportedLanguages. The
136 number of languages supported by a driver is up to the
137 driver writer.
138 ControllerName - A pointer to the Unicode string to return. This Unicode
139 string is the name of the controller specified by
140 ControllerHandle and ChildHandle in the language specified
141 by Language from the point of view of the driver specified
142 by This.
143
144 Returns:
145 EFI_SUCCESS - The Unicode string for the user readable name in the
146 language specified by Language for the driver
147 specified by This was returned in DriverName.
148 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
149 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
150 EFI_INVALID_PARAMETER - Language is NULL.
151 EFI_INVALID_PARAMETER - ControllerName is NULL.
152 EFI_UNSUPPORTED - The driver specified by This is not currently managing
153 the controller specified by ControllerHandle and
154 ChildHandle.
155 EFI_UNSUPPORTED - The driver specified by This does not support the
156 language specified by Language.
157
158 --*/
159 {
160 return EFI_UNSUPPORTED;
161 }