|
@@ -37,7 +37,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
37
|
37
|
|
38
|
38
|
/** Device path to text protocol */
|
39
|
39
|
static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *efidpt;
|
40
|
|
-EFI_REQUIRE_PROTOCOL ( EFI_DEVICE_PATH_TO_TEXT_PROTOCOL, &efidpt );
|
|
40
|
+EFI_REQUEST_PROTOCOL ( EFI_DEVICE_PATH_TO_TEXT_PROTOCOL, &efidpt );
|
41
|
41
|
|
42
|
42
|
/**
|
43
|
43
|
* Convert GUID to a printable string
|
|
@@ -99,19 +99,25 @@ void dbg_efi_devpath ( EFI_DEVICE_PATH_PROTOCOL *path ) {
|
99
|
99
|
size_t len;
|
100
|
100
|
|
101
|
101
|
/* Convert path to a textual representation */
|
|
102
|
+ if ( ! efidpt )
|
|
103
|
+ goto err_no_efidpt;
|
102
|
104
|
text = efidpt->ConvertDevicePathToText ( path, TRUE, FALSE );
|
103
|
|
- if ( ! text ) {
|
104
|
|
- printf ( "<cannot convert>:\n" );
|
105
|
|
- end = efi_devpath_end ( path );
|
106
|
|
- len = ( ( ( void * ) end ) - ( ( void * ) path ) +
|
107
|
|
- sizeof ( *end ) );
|
108
|
|
- dbg_hex_dump_da ( 0, path, len );
|
109
|
|
- return;
|
110
|
|
- }
|
|
105
|
+ if ( ! text )
|
|
106
|
+ goto err_convert;
|
111
|
107
|
|
112
|
108
|
/* Print path */
|
113
|
109
|
printf ( "%ls", text );
|
114
|
110
|
|
115
|
111
|
/* Free path */
|
116
|
112
|
bs->FreePool ( text );
|
|
113
|
+
|
|
114
|
+ return;
|
|
115
|
+
|
|
116
|
+ err_convert:
|
|
117
|
+ err_no_efidpt:
|
|
118
|
+ printf ( "<cannot convert>:\n" );
|
|
119
|
+ end = efi_devpath_end ( path );
|
|
120
|
+ len = ( ( ( void * ) end ) - ( ( void * ) path ) +
|
|
121
|
+ sizeof ( *end ) );
|
|
122
|
+ dbg_hex_dump_da ( 0, path, len );
|
117
|
123
|
}
|