2 * X11DRV display device functions
4 * Copyright 2019 Zhiyi Zhang for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(x11drv
);
31 static struct x11drv_display_device_handler host_handler
;
32 struct x11drv_display_device_handler desktop_handler
;
33 static struct x11drv_settings_handler settings_handler
;
35 #define NEXT_DEVMODEW(mode) ((DEVMODEW *)((char *)((mode) + 1) + (mode)->dmDriverExtra))
37 struct x11drv_display_depth
44 /* Display device emulated depth list, protected by modes_section */
45 static struct list x11drv_display_depth_list
= LIST_INIT(x11drv_display_depth_list
);
47 /* All Windows drivers seen so far either support 32 bit depths, or 24 bit depths, but never both. So if we have
48 * a 32 bit framebuffer, report 32 bit bpps, otherwise 24 bit ones.
50 static const unsigned int depths_24
[] = {8, 16, 24};
51 static const unsigned int depths_32
[] = {8, 16, 32};
52 const unsigned int *depths
;
54 static pthread_mutex_t settings_mutex
= PTHREAD_MUTEX_INITIALIZER
;
56 void X11DRV_Settings_SetHandler(const struct x11drv_settings_handler
*new_handler
)
58 if (new_handler
->priority
> settings_handler
.priority
)
60 settings_handler
= *new_handler
;
61 TRACE("Display settings are now handled by: %s.\n", settings_handler
.name
);
65 /***********************************************************************
66 * Default handlers if resolution switching is not enabled
69 static BOOL
nores_get_id(const WCHAR
*device_name
, ULONG_PTR
*id
)
71 WCHAR primary_adapter
[CCHDEVICENAME
];
73 if (!get_primary_adapter( primary_adapter
))
76 *id
= !wcsicmp( device_name
, primary_adapter
) ? 1 : 0;
80 static BOOL
nores_get_modes(ULONG_PTR id
, DWORD flags
, DEVMODEW
**new_modes
, UINT
*mode_count
)
82 RECT primary
= get_host_primary_monitor_rect();
85 modes
= calloc(1, sizeof(*modes
));
88 RtlSetLastWin32Error( ERROR_NOT_ENOUGH_MEMORY
);
92 modes
[0].dmSize
= sizeof(*modes
);
93 modes
[0].dmDriverExtra
= 0;
94 modes
[0].dmFields
= DM_DISPLAYORIENTATION
| DM_BITSPERPEL
| DM_PELSWIDTH
| DM_PELSHEIGHT
|
95 DM_DISPLAYFLAGS
| DM_DISPLAYFREQUENCY
;
96 modes
[0].dmDisplayOrientation
= DMDO_DEFAULT
;
97 modes
[0].dmBitsPerPel
= screen_bpp
;
98 modes
[0].dmPelsWidth
= primary
.right
;
99 modes
[0].dmPelsHeight
= primary
.bottom
;
100 modes
[0].dmDisplayFlags
= 0;
101 modes
[0].dmDisplayFrequency
= 60;
108 static void nores_free_modes(DEVMODEW
*modes
)
113 static BOOL
nores_get_current_mode(ULONG_PTR id
, DEVMODEW
*mode
)
115 RECT primary
= get_host_primary_monitor_rect();
117 mode
->dmFields
= DM_DISPLAYORIENTATION
| DM_BITSPERPEL
| DM_PELSWIDTH
| DM_PELSHEIGHT
|
118 DM_DISPLAYFLAGS
| DM_DISPLAYFREQUENCY
| DM_POSITION
;
119 mode
->dmDisplayOrientation
= DMDO_DEFAULT
;
120 mode
->dmDisplayFlags
= 0;
121 mode
->dmPosition
.x
= 0;
122 mode
->dmPosition
.y
= 0;
126 FIXME("Non-primary adapters are unsupported.\n");
127 mode
->dmBitsPerPel
= 0;
128 mode
->dmPelsWidth
= 0;
129 mode
->dmPelsHeight
= 0;
130 mode
->dmDisplayFrequency
= 0;
134 mode
->dmBitsPerPel
= screen_bpp
;
135 mode
->dmPelsWidth
= primary
.right
;
136 mode
->dmPelsHeight
= primary
.bottom
;
137 mode
->dmDisplayFrequency
= 60;
141 static LONG
nores_set_current_mode(ULONG_PTR id
, const DEVMODEW
*mode
)
143 WARN("NoRes settings handler, ignoring mode change request.\n");
144 return DISP_CHANGE_SUCCESSFUL
;
147 /* default handler only gets the current X desktop resolution */
148 void X11DRV_Settings_Init(void)
150 struct x11drv_settings_handler nores_handler
;
152 depths
= screen_bpp
== 32 ? depths_32
: depths_24
;
154 nores_handler
.name
= "NoRes";
155 nores_handler
.priority
= 1;
156 nores_handler
.get_id
= nores_get_id
;
157 nores_handler
.get_modes
= nores_get_modes
;
158 nores_handler
.free_modes
= nores_free_modes
;
159 nores_handler
.get_current_mode
= nores_get_current_mode
;
160 nores_handler
.set_current_mode
= nores_set_current_mode
;
161 X11DRV_Settings_SetHandler(&nores_handler
);
164 /* Initialize registry display settings when new display devices are added */
165 void init_registry_display_settings(void)
167 DEVMODEW dm
= {.dmSize
= sizeof(dm
)};
168 DISPLAY_DEVICEW dd
= {sizeof(dd
)};
169 UNICODE_STRING device_name
;
173 while (!NtUserEnumDisplayDevices( NULL
, i
++, &dd
, 0 ))
175 RtlInitUnicodeString( &device_name
, dd
.DeviceName
);
177 /* Skip if the device already has registry display settings */
178 if (NtUserEnumDisplaySettings( &device_name
, ENUM_REGISTRY_SETTINGS
, &dm
, 0 ))
181 if (!NtUserEnumDisplaySettings( &device_name
, ENUM_CURRENT_SETTINGS
, &dm
, 0 ))
183 ERR("Failed to query current display settings for %s.\n", wine_dbgstr_w(dd
.DeviceName
));
187 TRACE("Device %s current display mode %ux%u %ubits %uHz at %d,%d.\n",
188 wine_dbgstr_w(dd
.DeviceName
), dm
.dmPelsWidth
, dm
.dmPelsHeight
, dm
.dmBitsPerPel
,
189 dm
.dmDisplayFrequency
, dm
.dmPosition
.x
, dm
.dmPosition
.y
);
191 ret
= NtUserChangeDisplaySettings( &device_name
, &dm
, NULL
,
192 CDS_GLOBAL
| CDS_NORESET
| CDS_UPDATEREGISTRY
, NULL
);
193 if (ret
!= DISP_CHANGE_SUCCESSFUL
)
194 ERR("Failed to save registry display settings for %s, returned %d.\n",
195 wine_dbgstr_w(dd
.DeviceName
), ret
);
199 BOOL
get_primary_adapter(WCHAR
*name
)
205 for (i
= 0; !NtUserEnumDisplayDevices( NULL
, i
, &dd
, 0 ); ++i
)
207 if (dd
.StateFlags
& DISPLAY_DEVICE_PRIMARY_DEVICE
)
209 lstrcpyW(name
, dd
.DeviceName
);
217 static void set_display_depth(ULONG_PTR display_id
, DWORD depth
)
219 struct x11drv_display_depth
*display_depth
;
221 pthread_mutex_lock( &settings_mutex
);
222 LIST_FOR_EACH_ENTRY(display_depth
, &x11drv_display_depth_list
, struct x11drv_display_depth
, entry
)
224 if (display_depth
->display_id
== display_id
)
226 display_depth
->depth
= depth
;
227 pthread_mutex_unlock( &settings_mutex
);
232 display_depth
= malloc(sizeof(*display_depth
));
235 ERR("Failed to allocate memory.\n");
236 pthread_mutex_unlock( &settings_mutex
);
240 display_depth
->display_id
= display_id
;
241 display_depth
->depth
= depth
;
242 list_add_head(&x11drv_display_depth_list
, &display_depth
->entry
);
243 pthread_mutex_unlock( &settings_mutex
);
246 static DWORD
get_display_depth(ULONG_PTR display_id
)
248 struct x11drv_display_depth
*display_depth
;
251 pthread_mutex_lock( &settings_mutex
);
252 LIST_FOR_EACH_ENTRY(display_depth
, &x11drv_display_depth_list
, struct x11drv_display_depth
, entry
)
254 if (display_depth
->display_id
== display_id
)
256 depth
= display_depth
->depth
;
257 pthread_mutex_unlock( &settings_mutex
);
261 pthread_mutex_unlock( &settings_mutex
);
265 /***********************************************************************
266 * GetCurrentDisplaySettings (X11DRV.@)
269 BOOL
X11DRV_GetCurrentDisplaySettings( LPCWSTR name
, LPDEVMODEW devmode
)
274 if (!settings_handler
.get_id( name
, &id
) || !settings_handler
.get_current_mode( id
, &mode
))
276 ERR("Failed to get %s current display settings.\n", wine_dbgstr_w(name
));
280 memcpy( &devmode
->dmFields
, &mode
.dmFields
, devmode
->dmSize
- offsetof(DEVMODEW
, dmFields
) );
281 if (!is_detached_mode( devmode
)) devmode
->dmBitsPerPel
= get_display_depth( id
);
285 BOOL
is_detached_mode(const DEVMODEW
*mode
)
287 return mode
->dmFields
& DM_POSITION
&&
288 mode
->dmFields
& DM_PELSWIDTH
&&
289 mode
->dmFields
& DM_PELSHEIGHT
&&
290 mode
->dmPelsWidth
== 0 &&
291 mode
->dmPelsHeight
== 0;
294 /* Get the full display mode with all the necessary fields set.
295 * Return NULL on failure. Caller should call free_full_mode() to free the returned mode. */
296 static DEVMODEW
*get_full_mode(ULONG_PTR id
, DEVMODEW
*dev_mode
)
298 DEVMODEW
*modes
, *full_mode
, *found_mode
= NULL
;
299 UINT mode_count
, mode_idx
;
301 if (is_detached_mode(dev_mode
))
304 if (!settings_handler
.get_modes(id
, EDS_ROTATEDMODE
, &modes
, &mode_count
))
307 for (mode_idx
= 0; mode_idx
< mode_count
; ++mode_idx
)
309 found_mode
= (DEVMODEW
*)((BYTE
*)modes
+ (sizeof(*modes
) + modes
[0].dmDriverExtra
) * mode_idx
);
311 if (found_mode
->dmBitsPerPel
!= dev_mode
->dmBitsPerPel
)
313 if (found_mode
->dmPelsWidth
!= dev_mode
->dmPelsWidth
)
315 if (found_mode
->dmPelsHeight
!= dev_mode
->dmPelsHeight
)
317 if (found_mode
->dmDisplayFrequency
!= dev_mode
->dmDisplayFrequency
)
319 if (found_mode
->dmDisplayOrientation
!= dev_mode
->dmDisplayOrientation
)
325 if (!found_mode
|| mode_idx
== mode_count
)
327 settings_handler
.free_modes(modes
);
331 if (!(full_mode
= malloc(sizeof(*found_mode
) + found_mode
->dmDriverExtra
)))
333 settings_handler
.free_modes(modes
);
337 memcpy(full_mode
, found_mode
, sizeof(*found_mode
) + found_mode
->dmDriverExtra
);
338 settings_handler
.free_modes(modes
);
340 full_mode
->dmFields
|= DM_POSITION
;
341 full_mode
->dmPosition
= dev_mode
->dmPosition
;
345 static void free_full_mode(DEVMODEW
*mode
)
347 if (!is_detached_mode(mode
))
351 static LONG
apply_display_settings( DEVMODEW
*displays
, ULONG_PTR
*ids
, BOOL do_attach
)
358 for (count
= 0, mode
= displays
; mode
->dmSize
; mode
= NEXT_DEVMODEW(mode
), count
++)
360 ULONG_PTR
*id
= ids
+ count
;
362 attached_mode
= !is_detached_mode(mode
);
363 if ((attached_mode
&& !do_attach
) || (!attached_mode
&& do_attach
))
366 /* FIXME: get a full mode again because X11 driver extra data isn't portable */
367 full_mode
= get_full_mode(*id
, mode
);
369 return DISP_CHANGE_BADMODE
;
371 TRACE("handler:%s changing %s to position:(%d,%d) resolution:%ux%u frequency:%uHz "
372 "depth:%ubits orientation:%#x.\n", settings_handler
.name
,
373 wine_dbgstr_w(mode
->dmDeviceName
),
374 full_mode
->dmPosition
.x
, full_mode
->dmPosition
.y
, full_mode
->dmPelsWidth
,
375 full_mode
->dmPelsHeight
, full_mode
->dmDisplayFrequency
, full_mode
->dmBitsPerPel
,
376 full_mode
->dmDisplayOrientation
);
378 ret
= settings_handler
.set_current_mode(*id
, full_mode
);
379 if (attached_mode
&& ret
== DISP_CHANGE_SUCCESSFUL
)
380 set_display_depth(*id
, full_mode
->dmBitsPerPel
);
381 free_full_mode(full_mode
);
382 if (ret
!= DISP_CHANGE_SUCCESSFUL
)
386 return DISP_CHANGE_SUCCESSFUL
;
389 /***********************************************************************
390 * ChangeDisplaySettings (X11DRV.@)
393 LONG
X11DRV_ChangeDisplaySettings( LPDEVMODEW displays
, HWND hwnd
, DWORD flags
, LPVOID lpvoid
)
395 INT left_most
= INT_MAX
, top_most
= INT_MAX
;
396 LONG count
, ret
= DISP_CHANGE_BADPARAM
;
400 /* Convert virtual screen coordinates to root coordinates, and find display ids.
401 * We cannot safely get the ids while changing modes, as the backend state may be invalidated.
403 for (count
= 0, mode
= displays
; mode
->dmSize
; mode
= NEXT_DEVMODEW(mode
), count
++)
405 left_most
= min( left_most
, mode
->dmPosition
.x
);
406 top_most
= min( top_most
, mode
->dmPosition
.y
);
409 if (!(ids
= calloc( count
, sizeof(*ids
) ))) return DISP_CHANGE_FAILED
;
410 for (count
= 0, mode
= displays
; mode
->dmSize
; mode
= NEXT_DEVMODEW(mode
), count
++)
412 if (!settings_handler
.get_id( mode
->dmDeviceName
, ids
+ count
)) goto done
;
413 mode
->dmPosition
.x
-= left_most
;
414 mode
->dmPosition
.y
-= top_most
;
417 /* Detach displays first to free up CRTCs */
418 ret
= apply_display_settings( displays
, ids
, FALSE
);
419 if (ret
== DISP_CHANGE_SUCCESSFUL
)
420 ret
= apply_display_settings( displays
, ids
, TRUE
);
421 if (ret
== DISP_CHANGE_SUCCESSFUL
)
422 X11DRV_DisplayDevices_Update();
429 POINT
virtual_screen_to_root(INT x
, INT y
)
431 RECT
virtual = NtUserGetVirtualScreenRect();
434 pt
.x
= x
- virtual.left
;
435 pt
.y
= y
- virtual.top
;
439 POINT
root_to_virtual_screen(INT x
, INT y
)
441 RECT
virtual = NtUserGetVirtualScreenRect();
444 pt
.x
= x
+ virtual.left
;
445 pt
.y
= y
+ virtual.top
;
449 /* Get the primary monitor rect from the host system */
450 RECT
get_host_primary_monitor_rect(void)
452 INT gpu_count
, adapter_count
, monitor_count
;
453 struct gdi_gpu
*gpus
= NULL
;
454 struct gdi_adapter
*adapters
= NULL
;
455 struct gdi_monitor
*monitors
= NULL
;
458 /* The first monitor is always primary */
459 if (host_handler
.get_gpus(&gpus
, &gpu_count
) && gpu_count
&&
460 host_handler
.get_adapters(gpus
[0].id
, &adapters
, &adapter_count
) && adapter_count
&&
461 host_handler
.get_monitors(adapters
[0].id
, &monitors
, &monitor_count
) && monitor_count
)
462 rect
= monitors
[0].rc_monitor
;
464 if (gpus
) host_handler
.free_gpus(gpus
);
465 if (adapters
) host_handler
.free_adapters(adapters
);
466 if (monitors
) host_handler
.free_monitors(monitors
, monitor_count
);
470 BOOL
get_host_primary_gpu(struct gdi_gpu
*gpu
)
472 struct gdi_gpu
*gpus
;
475 if (host_handler
.get_gpus(&gpus
, &gpu_count
) && gpu_count
)
478 host_handler
.free_gpus(gpus
);
485 RECT
get_work_area(const RECT
*monitor_rect
)
489 unsigned long count
, remaining
, i
;
493 /* Try _GTK_WORKAREAS first as _NET_WORKAREA may be incorrect on multi-monitor systems */
494 if (!XGetWindowProperty(gdi_display
, DefaultRootWindow(gdi_display
),
495 x11drv_atom(_GTK_WORKAREAS_D0
), 0, ~0, False
, XA_CARDINAL
, &type
,
496 &format
, &count
, &remaining
, (unsigned char **)&work_area
))
498 if (type
== XA_CARDINAL
&& format
== 32)
500 for (i
= 0; i
< count
/ 4; ++i
)
502 work_rect
.left
= work_area
[i
* 4];
503 work_rect
.top
= work_area
[i
* 4 + 1];
504 work_rect
.right
= work_rect
.left
+ work_area
[i
* 4 + 2];
505 work_rect
.bottom
= work_rect
.top
+ work_area
[i
* 4 + 3];
507 if (intersect_rect( &work_rect
, &work_rect
, monitor_rect
))
509 TRACE("work_rect:%s.\n", wine_dbgstr_rect(&work_rect
));
518 WARN("_GTK_WORKAREAS is not supported, fallback to _NET_WORKAREA. "
519 "Work areas may be incorrect on multi-monitor systems.\n");
520 if (!XGetWindowProperty(gdi_display
, DefaultRootWindow(gdi_display
), x11drv_atom(_NET_WORKAREA
),
521 0, ~0, False
, XA_CARDINAL
, &type
, &format
, &count
, &remaining
,
522 (unsigned char **)&work_area
))
524 if (type
== XA_CARDINAL
&& format
== 32 && count
>= 4)
526 SetRect(&work_rect
, work_area
[0], work_area
[1], work_area
[0] + work_area
[2],
527 work_area
[1] + work_area
[3]);
529 if (intersect_rect( &work_rect
, &work_rect
, monitor_rect
))
531 TRACE("work_rect:%s.\n", wine_dbgstr_rect(&work_rect
));
539 WARN("_NET_WORKAREA is not supported, Work areas may be incorrect.\n");
540 TRACE("work_rect:%s.\n", wine_dbgstr_rect(monitor_rect
));
541 return *monitor_rect
;
544 void X11DRV_DisplayDevices_SetHandler(const struct x11drv_display_device_handler
*new_handler
)
546 if (new_handler
->priority
> host_handler
.priority
)
548 host_handler
= *new_handler
;
549 TRACE("Display device functions are now handled by: %s\n", host_handler
.name
);
553 void X11DRV_DisplayDevices_RegisterEventHandlers(void)
555 struct x11drv_display_device_handler
*handler
= is_virtual_desktop() ? &desktop_handler
: &host_handler
;
557 if (handler
->register_event_handlers
)
558 handler
->register_event_handlers();
561 void X11DRV_DisplayDevices_Update(void)
563 RECT old_virtual_rect
, new_virtual_rect
;
569 old_virtual_rect
= NtUserGetVirtualScreenRect();
570 X11DRV_DisplayDevices_Init(TRUE
);
571 new_virtual_rect
= NtUserGetVirtualScreenRect();
573 /* Calculate XReconfigureWMWindow() mask */
574 if (old_virtual_rect
.left
!= new_virtual_rect
.left
)
576 if (old_virtual_rect
.top
!= new_virtual_rect
.top
)
579 X11DRV_resize_desktop();
581 list
= build_hwnd_list();
582 for (i
= 0; list
&& list
[i
] != HWND_BOTTOM
; i
++)
584 struct x11drv_win_data
*data
;
586 if (!(data
= get_win_data( list
[i
] ))) continue;
588 /* update the full screen state */
589 update_net_wm_states(data
);
591 if (mask
&& data
->whole_window
)
593 POINT pos
= virtual_screen_to_root(data
->whole_rect
.left
, data
->whole_rect
.top
);
594 XWindowChanges changes
;
597 XReconfigureWMWindow(data
->display
, data
->whole_window
, data
->vis
.screen
, mask
, &changes
);
599 release_win_data(data
);
604 /* forward clip_fullscreen_window request to the foreground window */
605 if ((foreground
= NtUserGetForegroundWindow()) &&
606 (tid
= NtUserGetWindowThread( foreground
, &pid
)) && pid
== GetCurrentProcessId())
608 if (tid
== GetCurrentThreadId()) clip_fullscreen_window( foreground
, TRUE
);
609 else send_notify_message( foreground
, WM_X11DRV_CLIP_CURSOR_REQUEST
, TRUE
, TRUE
);
613 static BOOL force_display_devices_refresh
;
615 BOOL
X11DRV_UpdateDisplayDevices( const struct gdi_device_manager
*device_manager
, BOOL force
, void *param
)
617 struct x11drv_display_device_handler
*handler
;
618 struct gdi_adapter
*adapters
;
619 struct gdi_monitor
*monitors
;
620 struct gdi_gpu
*gpus
;
621 INT gpu_count
, adapter_count
, monitor_count
;
622 INT gpu
, adapter
, monitor
;
623 DEVMODEW
*modes
, *mode
;
626 if (!force
&& !force_display_devices_refresh
) return TRUE
;
627 force_display_devices_refresh
= FALSE
;
628 handler
= is_virtual_desktop() ? &desktop_handler
: &host_handler
;
630 TRACE("via %s\n", wine_dbgstr_a(handler
->name
));
632 /* Initialize GPUs */
633 if (!handler
->get_gpus( &gpus
, &gpu_count
)) return FALSE
;
634 TRACE("GPU count: %d\n", gpu_count
);
636 for (gpu
= 0; gpu
< gpu_count
; gpu
++)
638 device_manager
->add_gpu( &gpus
[gpu
], param
);
640 /* Initialize adapters */
641 if (!handler
->get_adapters(gpus
[gpu
].id
, &adapters
, &adapter_count
)) break;
642 TRACE("GPU: %#lx %s, adapter count: %d\n", gpus
[gpu
].id
, wine_dbgstr_w(gpus
[gpu
].name
), adapter_count
);
644 for (adapter
= 0; adapter
< adapter_count
; adapter
++)
646 device_manager
->add_adapter( &adapters
[adapter
], param
);
648 if (!handler
->get_monitors(adapters
[adapter
].id
, &monitors
, &monitor_count
)) break;
649 TRACE("adapter: %#lx, monitor count: %d\n", adapters
[adapter
].id
, monitor_count
);
651 /* Initialize monitors */
652 for (monitor
= 0; monitor
< monitor_count
; monitor
++)
654 TRACE("monitor: %#x %s\n", monitor
, wine_dbgstr_w(monitors
[monitor
].name
));
655 device_manager
->add_monitor( &monitors
[monitor
], param
);
658 handler
->free_monitors(monitors
, monitor_count
);
660 if (!settings_handler
.get_modes( adapters
[adapter
].id
, EDS_ROTATEDMODE
, &modes
, &mode_count
))
663 for (mode
= modes
; mode_count
; mode_count
--)
665 TRACE( "mode: %p\n", mode
);
666 device_manager
->add_mode( mode
, param
);
667 mode
= (DEVMODEW
*)((char *)mode
+ sizeof(*modes
) + modes
[0].dmDriverExtra
);
670 settings_handler
.free_modes( modes
);
673 handler
->free_adapters(adapters
);
676 handler
->free_gpus(gpus
);
680 void X11DRV_DisplayDevices_Init(BOOL force
)
682 UINT32 num_path
, num_mode
;
684 if (force
) force_display_devices_refresh
= TRUE
;
685 /* trigger refresh in win32u */
686 NtUserGetDisplayConfigBufferSizes( QDC_ONLY_ACTIVE_PATHS
, &num_path
, &num_mode
);