Does it possible to reallocate PCIe BAR memory without restart or Hot-Plug (Windows-7 drivers related) - pci-e

My PC has Win-7 Embedded and I'm trying to connect to PCIe switch BAR.
At first when windows detects the PCIe switch it is not configured to use the requested BAR.
After my program change the switch settings it is required to restart windows in order to detect and use the BAR,
If Hot-Plug functionality is enabled at the BIOS it is possible to only rescan the Device Manager and the BAR is detected by Windows without any restart.
The problem is that I don't want to use Hot-Plug because it can cause various problems.
Is it possible to detect the BAR without restart and without using Hot-Plug?
I also noticed that windows automatically assign the BAR memory address,
Is it possible to manually assign the BAR memory address?
Thanks

Related

How to apply policy to offline device

I am using Android management API. I have applied policy to device and turned it to kiosk mode. After a while when I turn on the device, it is not connected to wifi anymore and is still in kiosk mode. Therefore I cannot connect it manually or update its policy. Is there a way to solve it ?
Unfortunately, as you cannot open the wifi dialog and devices cannot update the policy without a connection, the only way to workaround this is to hard reset the device per OEM instruction.
In the future, you can use KioskCustomization to have access to the status bar and navigation buttons so there would be no need to hard reset the device again if there is no connection as you can open the wifi dialog with this.
For people wondering how to escape the kiosk mode. There should be a way for your device to reboot to recovery mode. I my case - samsung tablet - I hold power button and volume down button for a while and when samsung logo appeared a released the power button, but still hold the volume down button. In recovery mode I were able to connect to wifi manually.

Prevent disconnected display from merging windows into the active one

I've got a personal laptop (running Windows 10) which I use at work where I connect it to an external display using extended display mode. I keep all my personal icons and windows on my laptop display and store all the work-related windows on the external display. Whenever I unplug it, all the windows and icons from that display are merged into my laptop screen. I want to programmatically prevent changing anything on my primary screen when the secondary is disconnected. I'm currently writing a utility app for a variety of small productivity improving features and would like to add such feature in it. I can think of two ways to achieve this:
by tricking the system to think that the external display hasn't been
disconnected;
or take all the opened windows and icons on disconnected screen and put them on separate virtual desktop.
I was looking into Windows GDI Device Context Functions but haven't found anything about display connection/disconnection events. How can I detect display disconnection (and get that display's opened windows and icons)? Anything that can be done using C#, C++ or PowerShell scripts would be much appreciated!

Find physical device associated with primary monitor

With multi-monitor setups and OpenGL/Direct3D 11, Windows selects the device that the primary monitor is connected to. I'm trying to emulate this behavior with Vulkan. How can I figure out which physical device returned by vkEnumeratePhysicalDevices is the primary monitor connected to?
Generally speaking you should not care.
Create in platform-specific ways the Platform Window on whatever monitor you want. Create VkSurface from the Platform Window. Check support with vkGetPhysicalDeviceSurfaceSupportKHR (resp. pick VkPhysicalDevice and Queue Family that has the support). And be content with that — you can now draw to the window (until told otherwise by the Vulkan).
But you can abuse that, creating a window on primary monitor and asking if it is supported by any Queue Family of the Physical Device. If so then the Physical Device is connected or is otherwisely capable to present on the primary monitor.

Print Screen button seems to bug check Windows when debug boot option is enabled

I'm doing some driver development on my Windows machine and I've been wondering why pressing the PrtSc (print screen) button to take a screen capture seems to hang my machine. There are some forums that suggest this happens when the DEBUG boot option is set in Windows and that this is a panic/bug-check in the Windows kernel.
Is this a Windows bug? Or is this actually useful in some way, like in Linux where PrtSc/SysRq is actually a kernel interrupt key?
UPDATE #1: I'm using Windows 7 x64 Professional Build 7601.
https://msdn.microsoft.com/en-us/library/windows/hardware/ff541727(v=vs.85).aspx
You can disable the SYSRQ key by editing the registry. In the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\i8042prt\Parameters registry key, create a value named BreakOnSysRq and set it equal to DWORD 0x0. Then, restart the computer. After you have restarted the computer, you can press the SYSRQ key on the target computer's keyboard and it will not break into the kernel debugger.
Obviously, you're likely using a usb keyboard, so make sure to add the BreakOnSysRq = 0 value data pair to kbdhid\Parameters (and for good measure hidusb and kbdclass, not i8042prt. This will prevent the PrntScr key from being interpreted as SysRq.

What to expect when Airplane mode is enabled during wifi scan?

I'm using windows WLAN APIs (Windows Desktop not Metro Apps) to scan WiFi networks.
I'm curious what will be the behavior of the WiFi scan when Airplane mode is enabled before the scan is completed?
I'm trying to create such scenario but it very hard to catch such timing.
Any ideas?
Technically speaking, "Airplane Mode" Takes the Radio Transmitters in your iPhone and changes their frequencies of transmission to frequencies that are sympathetic to Aeronautic Instrumentation, such as Guidance Systems for example.
Due to the frequency change, if you're scanning Networks and then you change the properties of the Network adapter, the adapter has to restart. So, your Scan will be temporarily interrupted.
Test it on your iPhone, download something from App Store and switch modes during the download, see what happens. The Icon will suddenly stop and will display "SEARCHING" and will then re attempt to pick up the connection again.

Resources