]>
Commit | Line | Data |
---|---|---|
a432c703 | 1 | /** @file\r |
2 | Module produce UC on top of UC2.\r | |
3 | \r | |
4 | UEFI 2.1 specification supersedes Inte's EFI Specification 1.10.\r | |
5 | UNICODE_COLLATION_PROTOCOL defined in Inte's EFI Specification 1.10 is replaced by\r | |
6 | EFI_UNICODE_COLLATION_PROTOCOL in UEFI 2.1.\r | |
7 | This module produces UC on top of UC2. This module is used on platform when both of\r | |
8 | these two conditions are true:\r | |
9 | 1) EFI 1.10 module consuming UC present\r | |
10 | 2) And the rest of modules on the platform produce UC2\r | |
11 | \r | |
12 | Copyright (c) 2006 - 2008 Intel Corporation. <BR>\r | |
13 | All rights reserved. This program and the accompanying materials\r | |
14 | are licensed and made available under the terms and conditions of the BSD License\r | |
15 | which accompanies this distribution. The full text of the license may be found at\r | |
16 | http://opensource.org/licenses/bsd-license.php\r | |
17 | \r | |
18 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
19 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
20 | Module Name:\r | |
21 | \r | |
22 | **/\r | |
23 | \r | |
24 | #include <PiDxe.h>\r | |
25 | #include <Protocol/UnicodeCollation.h>\r | |
26 | #include <Library/BaseLib.h>\r | |
27 | #include <Library/DebugLib.h>\r | |
28 | #include <Library/UefiBootServicesTableLib.h>\r | |
29 | #include <Library/UefiDriverEntryPoint.h>\r | |
30 | #include <Library/UefiLib.h>\r | |
31 | #include <Library/MemoryAllocationLib.h>\r | |
32 | #include <Library/HiiLib.h>\r | |
ad5a96ab | 33 | #include <Library/BaseMemoryLib.h>\r |
a432c703 | 34 | \r |
35 | \r | |
974a0271 | 36 | ///\r |
37 | /// The size of a 3 character ISO639 language code.\r | |
38 | ///\r | |
39 | #define ISO_639_2_ENTRY_SIZE 3\r | |
40 | \r | |
ad5a96ab | 41 | //\r |
42 | // Lookup table of ISO639-2 3 character language codes to ISO 639-1 2 character language codes\r | |
43 | // Each entry is 5 CHAR8 values long. The first 3 CHAR8 values are the ISO 639-2 code.\r | |
44 | // The last 2 CHAR8 values are the ISO 639-1 code.\r | |
45 | //\r | |
46 | GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 Iso639ToRfc3066ConversionTable[] =\r | |
47 | "\\r | |
48 | aaraa\\r | |
49 | abkab\\r | |
50 | afraf\\r | |
51 | amham\\r | |
52 | araar\\r | |
53 | asmas\\r | |
54 | aymay\\r | |
55 | azeaz\\r | |
56 | bakba\\r | |
57 | belbe\\r | |
58 | benbn\\r | |
59 | bihbh\\r | |
60 | bisbi\\r | |
61 | bodbo\\r | |
62 | brebr\\r | |
63 | bulbg\\r | |
64 | catca\\r | |
65 | cescs\\r | |
66 | corkw\\r | |
67 | cosco\\r | |
68 | cymcy\\r | |
69 | danda\\r | |
70 | deude\\r | |
71 | dzodz\\r | |
72 | ellel\\r | |
73 | engen\\r | |
74 | epoeo\\r | |
75 | estet\\r | |
76 | euseu\\r | |
77 | faofo\\r | |
78 | fasfa\\r | |
79 | fijfj\\r | |
80 | finfi\\r | |
81 | frafr\\r | |
82 | fryfy\\r | |
83 | gaiga\\r | |
84 | gdhgd\\r | |
85 | glggl\\r | |
86 | grngn\\r | |
87 | gujgu\\r | |
88 | hauha\\r | |
89 | hebhe\\r | |
90 | hinhi\\r | |
91 | hrvhr\\r | |
92 | hunhu\\r | |
93 | hyehy\\r | |
94 | ikuiu\\r | |
95 | ileie\\r | |
96 | inaia\\r | |
97 | indid\\r | |
98 | ipkik\\r | |
99 | islis\\r | |
100 | itait\\r | |
101 | jawjw\\r | |
102 | jpnja\\r | |
103 | kalkl\\r | |
104 | kankn\\r | |
105 | kasks\\r | |
106 | katka\\r | |
107 | kazkk\\r | |
108 | khmkm\\r | |
109 | kinrw\\r | |
110 | kirky\\r | |
111 | korko\\r | |
112 | kurku\\r | |
113 | laolo\\r | |
114 | latla\\r | |
115 | lavlv\\r | |
116 | linln\\r | |
117 | litlt\\r | |
118 | ltzlb\\r | |
119 | malml\\r | |
120 | marmr\\r | |
121 | mkdmk\\r | |
122 | mlgmg\\r | |
123 | mltmt\\r | |
124 | molmo\\r | |
125 | monmn\\r | |
126 | mrimi\\r | |
127 | msams\\r | |
128 | myamy\\r | |
129 | nauna\\r | |
130 | nepne\\r | |
131 | nldnl\\r | |
132 | norno\\r | |
133 | ocioc\\r | |
134 | ormom\\r | |
135 | panpa\\r | |
136 | polpl\\r | |
137 | porpt\\r | |
138 | pusps\\r | |
139 | quequ\\r | |
140 | rohrm\\r | |
141 | ronro\\r | |
142 | runrn\\r | |
143 | rusru\\r | |
144 | sagsg\\r | |
145 | sansa\\r | |
146 | sinsi\\r | |
147 | slksk\\r | |
148 | slvsl\\r | |
149 | smise\\r | |
150 | smosm\\r | |
151 | snasn\\r | |
152 | sndsd\\r | |
153 | somso\\r | |
154 | sotst\\r | |
155 | spaes\\r | |
156 | sqisq\\r | |
157 | srpsr\\r | |
158 | sswss\\r | |
159 | sunsu\\r | |
160 | swasw\\r | |
161 | swesv\\r | |
162 | tamta\\r | |
163 | tattt\\r | |
164 | telte\\r | |
165 | tgktg\\r | |
166 | tgltl\\r | |
167 | thath\\r | |
168 | tsnts\\r | |
169 | tuktk\\r | |
170 | twitw\\r | |
171 | uigug\\r | |
172 | ukruk\\r | |
173 | urdur\\r | |
174 | uzbuz\\r | |
175 | vievi\\r | |
176 | volvo\\r | |
177 | wolwo\\r | |
178 | xhoxh\\r | |
179 | yidyi\\r | |
180 | zhaza\\r | |
181 | zhozh\\r | |
182 | zulzu\\r | |
183 | ";\r | |
184 | \r | |
185 | /**\r | |
186 | Convert language code from RFC3066 to ISO639-2.\r | |
187 | \r | |
188 | @param LanguageRfc3066 RFC3066 language code.\r | |
189 | @param LanguageIso639 ISO639-2 language code.\r | |
190 | \r | |
191 | @retval EFI_SUCCESS Language code converted.\r | |
192 | @retval EFI_NOT_FOUND Language code not found.\r | |
193 | \r | |
194 | **/\r | |
195 | EFI_STATUS\r | |
196 | EFIAPI\r | |
197 | ConvertRfc3066LanguageToIso639Language (\r | |
198 | IN CHAR8 *LanguageRfc3066,\r | |
199 | OUT CHAR8 *LanguageIso639\r | |
200 | )\r | |
201 | {\r | |
202 | UINTN Index;\r | |
203 | \r | |
204 | if ((LanguageRfc3066[2] != '-') && (LanguageRfc3066[2] != 0)) {\r | |
205 | CopyMem (LanguageIso639, LanguageRfc3066, 3);\r | |
206 | return EFI_SUCCESS;\r | |
207 | }\r | |
208 | \r | |
209 | for (Index = 0; Iso639ToRfc3066ConversionTable[Index] != 0; Index += 5) {\r | |
210 | if (CompareMem (LanguageRfc3066, &Iso639ToRfc3066ConversionTable[Index + 3], 2) == 0) {\r | |
211 | CopyMem (LanguageIso639, &Iso639ToRfc3066ConversionTable[Index], 3);\r | |
212 | return EFI_SUCCESS;\r | |
213 | }\r | |
214 | }\r | |
215 | \r | |
216 | return EFI_NOT_FOUND;\r | |
217 | }\r | |
a432c703 | 218 | \r |
219 | /**\r | |
220 | Performs a case-insensitive comparison of two Null-terminated Unicode \r | |
221 | strings.\r | |
222 | \r | |
223 | @param This Protocol instance pointer.\r | |
224 | @param Str1 A pointer to a Null-terminated Unicode string.\r | |
225 | @param Str2 A pointer to a Null-terminated Unicode string.\r | |
226 | \r | |
227 | @retval 0 Str1 is equivalent to Str2\r | |
228 | @retval > 0 Str1 is lexically greater than Str2\r | |
229 | @retval < 0 Str1 is lexically less than Str2\r | |
230 | \r | |
231 | **/\r | |
232 | INTN\r | |
233 | EFIAPI\r | |
234 | StriColl (\r | |
235 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
236 | IN CHAR16 *Str1,\r | |
237 | IN CHAR16 *Str2\r | |
e00e1d46 | 238 | );\r |
a432c703 | 239 | \r |
240 | /**\r | |
241 | Converts all the Unicode characters in a Null-terminated Unicode string to \r | |
242 | lower case Unicode characters.\r | |
243 | \r | |
244 | @param This Protocol instance pointer.\r | |
245 | @param Str A pointer to a Null-terminated Unicode string.\r | |
246 | \r | |
247 | **/\r | |
248 | VOID\r | |
249 | EFIAPI\r | |
250 | StrLwr (\r | |
251 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
252 | IN OUT CHAR16 *Str\r | |
e00e1d46 | 253 | );\r |
a432c703 | 254 | \r |
255 | /**\r | |
256 | Converts all the Unicode characters in a Null-terminated Unicode string to upper\r | |
257 | case Unicode characters.\r | |
258 | \r | |
259 | @param This Protocol instance pointer.\r | |
260 | @param Str A pointer to a Null-terminated Unicode string.\r | |
261 | \r | |
262 | **/\r | |
263 | VOID\r | |
264 | EFIAPI\r | |
265 | StrUpr (\r | |
266 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
267 | IN OUT CHAR16 *Str\r | |
e00e1d46 | 268 | );\r |
a432c703 | 269 | \r |
270 | /**\r | |
271 | Performs a case-insensitive comparison of a Null-terminated Unicode \r | |
272 | pattern string and a Null-terminated Unicode string.\r | |
273 | \r | |
274 | @param This Protocol instance pointer.\r | |
275 | @param String A pointer to a Null-terminated Unicode string.\r | |
276 | @param Pattern A pointer to a Null-terminated Unicode pattern string.\r | |
277 | \r | |
278 | @retval TRUE Pattern was found in String.\r | |
279 | @retval FALSE Pattern was not found in String.\r | |
280 | \r | |
281 | **/\r | |
282 | BOOLEAN\r | |
283 | EFIAPI\r | |
284 | MetaiMatch (\r | |
285 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
286 | IN CHAR16 *String,\r | |
287 | IN CHAR16 *Pattern\r | |
e00e1d46 | 288 | );\r |
a432c703 | 289 | \r |
290 | /**\r | |
291 | Converts an 8.3 FAT file name in an OEM character set to a Null-terminated \r | |
292 | Unicode string.\r | |
293 | \r | |
294 | @param This Protocol instance pointer.\r | |
295 | @param FatSize The size of the string Fat in bytes.\r | |
296 | @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r | |
297 | name using an OEM character set.\r | |
298 | @param String A pointer to a Null-terminated Unicode string. The string must\r | |
299 | be preallocated to hold FatSize Unicode characters.\r | |
300 | \r | |
301 | **/\r | |
302 | VOID\r | |
303 | EFIAPI\r | |
304 | FatToStr (\r | |
305 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
306 | IN UINTN FatSize,\r | |
307 | IN CHAR8 *Fat,\r | |
308 | OUT CHAR16 *String\r | |
e00e1d46 | 309 | );\r |
a432c703 | 310 | \r |
311 | /**\r | |
312 | Converts a Null-terminated Unicode string to legal characters in a FAT \r | |
313 | filename using an OEM character set. \r | |
314 | \r | |
315 | @param This Protocol instance pointer.\r | |
316 | @param String A pointer to a Null-terminated Unicode string. The string must\r | |
317 | be preallocated to hold FatSize Unicode characters.\r | |
318 | @param FatSize The size of the string Fat in bytes.\r | |
319 | @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r | |
320 | name using an OEM character set.\r | |
321 | \r | |
322 | @retval TRUE Fat is a Long File Name\r | |
323 | @retval FALSE Fat is an 8.3 file name\r | |
324 | \r | |
325 | **/\r | |
326 | BOOLEAN\r | |
327 | EFIAPI\r | |
328 | StrToFat (\r | |
329 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
330 | IN CHAR16 *String,\r | |
331 | IN UINTN FatSize,\r | |
332 | OUT CHAR8 *Fat\r | |
e00e1d46 | 333 | );\r |
a432c703 | 334 | \r |
a3a83173 | 335 | #define UC_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('_', 'U', 'C', '_')\r |
a432c703 | 336 | \r |
337 | typedef struct {\r | |
338 | UINT32 Signature;\r | |
339 | EFI_UNICODE_COLLATION_PROTOCOL UC;\r | |
340 | EFI_UNICODE_COLLATION_PROTOCOL *UC2;\r | |
341 | } UC_PRIVATE_DATA;\r | |
342 | \r | |
343 | #define UC_PRIVATE_DATA_FROM_THIS(a) CR (a, UC_PRIVATE_DATA, UC, UC_PRIVATE_DATA_SIGNATURE)\r | |
344 | \r | |
345 | //\r | |
346 | // Firmware Volume Protocol template\r | |
347 | //\r | |
348 | EFI_EVENT mUcRegistration;\r | |
349 | \r | |
350 | UC_PRIVATE_DATA gUCPrivateDataTemplate = {\r | |
351 | UC_PRIVATE_DATA_SIGNATURE,\r | |
352 | {\r | |
353 | StriColl,\r | |
354 | MetaiMatch,\r | |
355 | StrLwr,\r | |
356 | StrUpr,\r | |
357 | FatToStr,\r | |
358 | StrToFat,\r | |
359 | NULL\r | |
360 | },\r | |
361 | NULL\r | |
362 | };\r | |
363 | \r | |
364 | //\r | |
365 | // Module globals\r | |
366 | //\r | |
367 | \r | |
368 | VOID\r | |
369 | EFIAPI\r | |
370 | Uc2NotificationEvent (\r | |
371 | IN EFI_EVENT Event,\r | |
372 | IN VOID *Context\r | |
373 | )\r | |
374 | {\r | |
375 | EFI_STATUS Status;\r | |
376 | UINTN BufferSize;\r | |
377 | EFI_HANDLE Handle;\r | |
378 | UC_PRIVATE_DATA *Private;\r | |
379 | EFI_UNICODE_COLLATION_PROTOCOL *Uc2;\r | |
380 | \r | |
381 | while (TRUE) {\r | |
382 | BufferSize = sizeof (Handle);\r | |
383 | Status = gBS->LocateHandle (\r | |
384 | ByRegisterNotify,\r | |
385 | &gEfiUnicodeCollation2ProtocolGuid,\r | |
386 | mUcRegistration,\r | |
387 | &BufferSize,\r | |
388 | &Handle\r | |
389 | );\r | |
390 | if (EFI_ERROR (Status)) {\r | |
391 | //\r | |
392 | // Exit Path of While Loop....\r | |
393 | //\r | |
394 | break;\r | |
395 | }\r | |
396 | \r | |
397 | //\r | |
398 | // Skip this handle if the Firmware Volume Protocol is already installed\r | |
399 | //\r | |
400 | Status = gBS->HandleProtocol (\r | |
401 | Handle,\r | |
402 | &gEfiUnicodeCollationProtocolGuid,\r | |
403 | (VOID **)&Uc2\r | |
404 | );\r | |
405 | if (!EFI_ERROR (Status)) {\r | |
406 | continue;\r | |
407 | }\r | |
408 | \r | |
409 | //\r | |
410 | // Allocate private data structure\r | |
411 | //\r | |
412 | Private = AllocateCopyPool (sizeof (UC_PRIVATE_DATA), &gUCPrivateDataTemplate);\r | |
413 | if (Private == NULL) {\r | |
414 | continue;\r | |
415 | }\r | |
416 | \r | |
417 | //\r | |
418 | // Retrieve the UC Protocol\r | |
419 | //\r | |
420 | Status = gBS->HandleProtocol (\r | |
421 | Handle,\r | |
422 | &gEfiUnicodeCollation2ProtocolGuid,\r | |
423 | (VOID **)&Private->UC2\r | |
424 | );\r | |
425 | ASSERT_EFI_ERROR (Status);\r | |
426 | \r | |
427 | //\r | |
428 | // Fill in rest of private data structure\r | |
429 | //\r | |
430 | Private->UC.SupportedLanguages = AllocateZeroPool (ISO_639_2_ENTRY_SIZE + 1);\r | |
431 | Status = ConvertRfc3066LanguageToIso639Language (Private->UC2->SupportedLanguages, Private->UC.SupportedLanguages);\r | |
432 | \r | |
433 | if (!EFI_ERROR (Status)) {\r | |
434 | \r | |
435 | //\r | |
436 | // Install Firmware Volume Protocol onto same handle\r | |
437 | //\r | |
438 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
439 | &Handle,\r | |
440 | &gEfiUnicodeCollationProtocolGuid,\r | |
441 | &Private->UC,\r | |
442 | NULL\r | |
443 | );\r | |
444 | ASSERT_EFI_ERROR (Status);\r | |
445 | }\r | |
446 | }\r | |
447 | }\r | |
448 | \r | |
449 | \r | |
450 | /**\r | |
451 | The user Entry Point for DXE driver. The user code starts with this function\r | |
452 | as the real entry point for the image goes into a library that calls this \r | |
453 | function.\r | |
454 | \r | |
455 | @param[in] ImageHandle The firmware allocated handle for the EFI image. \r | |
456 | @param[in] SystemTable A pointer to the EFI System Table.\r | |
457 | \r | |
458 | @retval EFI_SUCCESS The entry point is executed successfully.\r | |
459 | @retval other Some error occurs when executing this entry point.\r | |
460 | \r | |
461 | **/\r | |
462 | EFI_STATUS\r | |
463 | EFIAPI\r | |
464 | InitializeUC (\r | |
465 | IN EFI_HANDLE ImageHandle,\r | |
466 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
467 | )\r | |
468 | {\r | |
469 | EfiCreateProtocolNotifyEvent (\r | |
185be2e0 | 470 | &gEfiUnicodeCollation2ProtocolGuid,\r |
a432c703 | 471 | TPL_CALLBACK,\r |
472 | Uc2NotificationEvent,\r | |
473 | NULL,\r | |
474 | &mUcRegistration\r | |
475 | );\r | |
476 | return EFI_SUCCESS;\r | |
477 | }\r | |
478 | \r | |
479 | \r | |
480 | /**\r | |
481 | Performs a case-insensitive comparison of two Null-terminated Unicode \r | |
482 | strings.\r | |
483 | \r | |
484 | @param This Protocol instance pointer.\r | |
485 | @param Str1 A pointer to a Null-terminated Unicode string.\r | |
486 | @param Str2 A pointer to a Null-terminated Unicode string.\r | |
487 | \r | |
488 | @retval 0 Str1 is equivalent to Str2\r | |
489 | @retval > 0 Str1 is lexically greater than Str2\r | |
490 | @retval < 0 Str1 is lexically less than Str2\r | |
491 | \r | |
492 | **/\r | |
493 | INTN\r | |
494 | EFIAPI\r | |
495 | StriColl (\r | |
496 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
497 | IN CHAR16 *Str1,\r | |
498 | IN CHAR16 *Str2\r | |
499 | )\r | |
500 | {\r | |
501 | UC_PRIVATE_DATA *Private;\r | |
502 | \r | |
503 | Private = UC_PRIVATE_DATA_FROM_THIS (This);\r | |
504 | \r | |
505 | return Private->UC2->StriColl (Private->UC2, Str1, Str2);\r | |
506 | }\r | |
507 | \r | |
508 | \r | |
509 | /**\r | |
510 | Converts all the Unicode characters in a Null-terminated Unicode string to \r | |
511 | lower case Unicode characters.\r | |
512 | \r | |
513 | @param This Protocol instance pointer.\r | |
514 | @param Str A pointer to a Null-terminated Unicode string.\r | |
515 | \r | |
516 | **/\r | |
517 | VOID\r | |
518 | EFIAPI\r | |
519 | StrLwr (\r | |
520 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
521 | IN OUT CHAR16 *Str\r | |
522 | )\r | |
523 | {\r | |
524 | UC_PRIVATE_DATA *Private;\r | |
525 | \r | |
526 | Private = UC_PRIVATE_DATA_FROM_THIS (This);\r | |
527 | \r | |
528 | Private->UC2->StrLwr (Private->UC2, Str);\r | |
529 | }\r | |
530 | \r | |
531 | \r | |
532 | /**\r | |
533 | Converts all the Unicode characters in a Null-terminated Unicode string to upper\r | |
534 | case Unicode characters.\r | |
535 | \r | |
536 | @param This Protocol instance pointer.\r | |
537 | @param Str A pointer to a Null-terminated Unicode string.\r | |
538 | \r | |
539 | **/\r | |
540 | VOID\r | |
541 | EFIAPI\r | |
542 | StrUpr (\r | |
543 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
544 | IN OUT CHAR16 *Str\r | |
545 | )\r | |
546 | {\r | |
547 | UC_PRIVATE_DATA *Private;\r | |
548 | \r | |
549 | Private = UC_PRIVATE_DATA_FROM_THIS (This);\r | |
550 | \r | |
551 | Private->UC2->StrUpr (Private->UC2, Str);\r | |
552 | }\r | |
553 | \r | |
554 | /**\r | |
555 | Performs a case-insensitive comparison of a Null-terminated Unicode \r | |
556 | pattern string and a Null-terminated Unicode string.\r | |
557 | \r | |
558 | @param This Protocol instance pointer.\r | |
559 | @param String A pointer to a Null-terminated Unicode string.\r | |
560 | @param Pattern A pointer to a Null-terminated Unicode pattern string.\r | |
561 | \r | |
562 | @retval TRUE Pattern was found in String.\r | |
563 | @retval FALSE Pattern was not found in String.\r | |
564 | \r | |
565 | **/\r | |
566 | BOOLEAN\r | |
567 | EFIAPI\r | |
568 | MetaiMatch (\r | |
569 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
570 | IN CHAR16 *String,\r | |
571 | IN CHAR16 *Pattern\r | |
572 | )\r | |
573 | {\r | |
574 | UC_PRIVATE_DATA *Private;\r | |
575 | \r | |
576 | Private = UC_PRIVATE_DATA_FROM_THIS (This);\r | |
577 | \r | |
578 | return Private->UC2->MetaiMatch (Private->UC2, String, Pattern);\r | |
579 | }\r | |
580 | \r | |
581 | \r | |
582 | /**\r | |
583 | Converts an 8.3 FAT file name in an OEM character set to a Null-terminated \r | |
584 | Unicode string.\r | |
585 | \r | |
586 | @param This Protocol instance pointer.\r | |
587 | @param FatSize The size of the string Fat in bytes.\r | |
588 | @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r | |
589 | name using an OEM character set.\r | |
590 | @param String A pointer to a Null-terminated Unicode string. The string must\r | |
591 | be preallocated to hold FatSize Unicode characters.\r | |
592 | \r | |
593 | **/\r | |
594 | VOID\r | |
595 | EFIAPI\r | |
596 | FatToStr (\r | |
597 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
598 | IN UINTN FatSize,\r | |
599 | IN CHAR8 *Fat,\r | |
600 | OUT CHAR16 *String\r | |
601 | )\r | |
602 | {\r | |
603 | UC_PRIVATE_DATA *Private;\r | |
604 | \r | |
605 | Private = UC_PRIVATE_DATA_FROM_THIS (This);\r | |
606 | \r | |
607 | Private->UC2->FatToStr (Private->UC2, FatSize, Fat, String);\r | |
608 | }\r | |
609 | \r | |
610 | \r | |
611 | /**\r | |
612 | Converts a Null-terminated Unicode string to legal characters in a FAT \r | |
613 | filename using an OEM character set. \r | |
614 | \r | |
615 | @param This Protocol instance pointer.\r | |
616 | @param String A pointer to a Null-terminated Unicode string. The string must\r | |
617 | be preallocated to hold FatSize Unicode characters.\r | |
618 | @param FatSize The size of the string Fat in bytes.\r | |
619 | @param Fat A pointer to a Null-terminated string that contains an 8.3 file\r | |
620 | name using an OEM character set.\r | |
621 | \r | |
622 | @retval TRUE Fat is a Long File Name\r | |
623 | @retval FALSE Fat is an 8.3 file name\r | |
624 | \r | |
625 | **/\r | |
626 | BOOLEAN\r | |
627 | EFIAPI\r | |
628 | StrToFat (\r | |
629 | IN EFI_UNICODE_COLLATION_PROTOCOL *This,\r | |
630 | IN CHAR16 *String,\r | |
631 | IN UINTN FatSize,\r | |
632 | OUT CHAR8 *Fat\r | |
633 | )\r | |
634 | {\r | |
635 | UC_PRIVATE_DATA *Private;\r | |
636 | \r | |
637 | Private = UC_PRIVATE_DATA_FROM_THIS (This);\r | |
638 | \r | |
639 | return Private->UC2->StrToFat (Private->UC2, String, FatSize, Fat);\r | |
640 | }\r | |
641 | \r |