@@ -258,6 +258,7 @@ impl DevicePathFromTextProtocol {
258
258
str_to_utf16_ptr ( path)
259
259
. map ( |utf16_str| {
260
260
let out = unsafe { & * ( ( self . text_to_device_path_node ) ( utf16_str) ) } ;
261
+ // FIXME(csssuf)
261
262
// Ideally, at this point, we'd free utf16_str. However, free_pool(utf16_str) seems
262
263
// to hang here for unknown reasons. So we leak it.
263
264
out
@@ -268,6 +269,7 @@ impl DevicePathFromTextProtocol {
268
269
str_to_utf16_ptr ( path)
269
270
. map ( |utf16_str| {
270
271
let out = unsafe { & * ( ( self . text_to_device_path ) ( utf16_str) ) } ;
272
+ // FIXME(csssuf)
271
273
// Ideally, at this point, we'd free utf16_str. However, free_pool(utf16_str) seems
272
274
// to hang here for unknown reasons. So we leak it.
273
275
out
@@ -280,7 +282,7 @@ pub struct DevicePathUtilitiesProtocol {
280
282
get_device_path_size : * const CVoid ,
281
283
duplicate_device_path : * const CVoid ,
282
284
append_device_path : unsafe extern "win64" fn ( src1 : * const DevicePathProtocol , src2 : * const DevicePathProtocol ) -> * const DevicePathProtocol ,
283
- append_device_node : * const CVoid ,
285
+ append_device_node : unsafe extern "win64" fn ( path : * const DevicePathProtocol , node : * const DevicePathProtocol ) -> * const DevicePathProtocol ,
284
286
append_device_path_instance : * const CVoid ,
285
287
get_next_device_path_instance : * const CVoid ,
286
288
is_device_path_multi_instance : * const CVoid ,
@@ -309,6 +311,17 @@ impl DevicePathUtilitiesProtocol {
309
311
}
310
312
}
311
313
314
+ pub fn append_device_node ( & self , path : * const DevicePathProtocol , node : * const DevicePathProtocol ) -> Result < * const DevicePathProtocol , Status > {
315
+ unsafe {
316
+ let out = ( self . append_device_node ) ( path, node) ;
317
+ if out == 0 as * const DevicePathProtocol {
318
+ // See comment in append_device_path.
319
+ return Err ( Status :: OutOfResources ) ;
320
+ }
321
+ Ok ( out)
322
+ }
323
+ }
324
+
312
325
pub fn create_device_node < T : Into < u8 > , U : Into < u8 > > ( & self , node_type : T , node_subtype : U , node_length : u16 ) -> Result < * const DevicePathProtocol , Status > {
313
326
unsafe {
314
327
let out = ( self . create_device_node ) ( node_type. into ( ) , node_subtype. into ( ) , node_length) ;
0 commit comments