Windows 8 "devcon -remove" issue - windows-8

Running Windows 8 with 2 video cards, AMD/ATI 6870 + 4870. Windows 8 is disabling 48XX card seemingly random and for no reason that I have been able to see in the event viewer. My work around is uninstall in devmgmt.msc and rescan for hardware changes. It auto installs and works fine after for days.
Question is how to automate that process with devcon. Trying...
C:\Batch>devcon.exe listclass display
Listing 2 device(s) for setup class "Display" (Display adapters).
PCI\VEN_1002&DEV_6738&SUBSYS_E177174B&REV_00\4&1DCBFDE5&0&0010: AMD Radeon HD 6800 Series (Microsoft Corporation - WDDM v1.20)
PCI\VEN_1002&DEV_9442&SUBSYS_E810174B&REV_00\4&24DEEBC4&0&0018: ATI Radeon HD 4800 Series (Microsoft Corporation - WDDM v1.1)
C:\Batch>devcon.exe remove =display *HD 4800*
No devices removed.
Doesn't remove the adapter. Not sure what I am missing to get this to work. I don't work with devcon very much and just wanted to make a batch to speed this "fix".

You can't use adapter name as an id for devcon.
Use, for example, device id: devcon.exe remove =display *DEV_9442*.

Related

Finding USB Devices from VB.net

My background is that I have been supporting a Vb5 application which controls my customers equipment in real time. He is now developing a new control board which will be connected to the PC via USB.
As I understand it connecting the device will generate a Com port. At the same time we will upgrade to VB.net, which is new to me.
I have Visual studio 2015 Community edition. I have written a routine using GetPortnames to ascertain how many com ports there are and what numbers (COM4, etc) they have.
How do I find what USB devices, if any, are attached to the com ports together with any identifying data of the device?
Already answered, next time please google first.
The key word that I type in google was: vb usb
Link

How does Bootcamp Assistent create a Windows Boot USB?

Im trying to reproduce the output of the Bootcamp Assistent, resulting in a bootable Windows USB (Windows 7/8/etc) on a Mac from Terminal.
The USB Stick created by BA (Bootcamp Assistent) works just fine on a Mac and on a PC, but all my tests trying to do it over Terminal resulted in a black screen with a blinking cursor (tested on a native Windows Laptop where the BA USB workes).
I have a original Win 8 iso downloaded directly from Microsoft, so that should not be the problem.
I tried to:
copy the .iso via dd like: dd if=win.iso of=/dev/rdisk1
copy the .iso via dd on a FAT32 partition on the USB: dd if=win.iso of=/dev/rdisk1s1
create a FAT32 partition and copy the content of the .iso to that partition.
did this: Create USB stick with Syslinux MBR
converte the .iso to other formats (eg img) and copyed with dd
The BA USB stick looks like this:
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *7.8 GB disk1
1: DOS_FAT_32 WININSTALL 7.8 GB disk1s1
Hopefully someone can tell me what I missed.
Okay, now i know how Bootcamp Assistent does his magic.. the MBR seems to be bigger than the normal 512 bytes so i did not get the whole thing.. seems to be 7680 bytes long (really dont know why).
But with that extracted mbr i got now it is working as i wanted it to be working.

Error running NI-DAQmx ANSI C example in Windows 7 virtual machine

I am running a Windows 7 guest system with an Ubuntu 14 host, using VirtualBox, and have run into a problem running even the simplest examples provided by National Instruments, using the ANSI C API for NI-DAQmx.
The first time the DAQ Device is powered on, I can run a single measurement, and after that, any other measurement displays the following error message:
Attempted to read samples that are no longer available.
The requested sample was previously available, but has since been overwritten.
Increasing the buffer size, reading the data more frequently, or specifying
a fixed number of samples to read instead of reading all available samples
might correct the problem.
Property: DAQmx_Read_RelativeTo
Corresponding Value: DAQmx_Val_CurrReadPos
Property: DAQmx_Read_Offset
Corresponding Value: 0
Task Name: _unamedTask(0)
Status Code: -200279
In order to be able to start a new measurement, I have to restart the DAQ device, probably in order to clear any internal buffers that are being overridden.
I am interested in running a basic continuous voltage measurement using a callback function. (The ContAcq_IntClk example provided by NI)
The exact same configuration, same version of NI-DAQmx(9.7.5), and running on Visual Studio 2012, runs smoothly on a machine running Windows 7 directly.
I suspect the problem is with the internal buffer being somehow messed up because of the connection with the Virtual Machine, but can't figure out an elegant solution to fix it.
The device I am using is NI USB-6289.
FIXED:
VirtualBox seems to have compatibility issues with NI USB devices. It appears to work, but it's unpredictable.
VMWare works much better. Switched to VMWare Player and now works flawless.

Creating a computer ID using Mono

I develop a few tools in C# using the .Net framework and I am considering the move to Mono. Based on the compatibility analyzer tool (MOMA), the only compatibility issue is the licensing code:
I use Window's serial number and a few other things to generate a computer ID which I then use to generate and manage my licenses.
Obviously, Windows will not be available on Linux or Mac, so I need another way to generate a computer ID.
What can I use in mono to create a reasonably reliable computer ID?
Use a MAC Address:
Get MAC Address in linux using mono
That should be unique to a given network interface, which would uniquely identify the machine.
Also, see this thread discussing the pitfalls and issues related to DRM in mono.
You can use a combination of either CPUID and a hard drive serial number.
As for your code, there is not going to be an elegant way to do this with a one-liner. You will have to check which platform you are running on via Environment.OSVersion. And then based on that, branch your code to do system-specific access. For example, to get CPUID/hdd serial number, use a WMI query; or parse the output of hdparm -I /dev/hda and go from there.
You could use a portion of how Microsoft checked hardware for Windows XP activation. They checked 10 items
Display Adapter
SCSI Adapter
IDE Adapter (effectively the motherboard)
Network Adapter (NIC) and its MAC Address
RAM Amount Range (i.e., 0-64mb, 64-128mb, etc.)
Processor Type
Processor Serial Number
Hard Drive Device
Hard Drive Volume Serial Number (VSN)
CD-ROM / CD-RW / DVD-ROM
When XP was (re)installed/activated it'd contact their servers and if 7 or more of the above items were unchanged it would activate without the need to speak with anyone.
I, personally, would recommend against using the MAC address. As you mentioned, it can be easily changed. Additionally, most machines have two or more network cards now (wired and wireless). It gets worse with virtualization as the MAC can be changed even more easily than the physical one can (do you license differently for virtual environments?)
Another option, instead of checking all 10 hardware components, is to use the UUID of the root file system. The downside of this, is that if the drive ever has issues, the license needs to be reacquired.
sudo blkid
/dev/sda1: TYPE="ntfs" UUID="72C0DE8EC0DE57C5" LABEL="windows"
/dev/sda2: UUID="30fcb748-ad1e-4228-af2f-951e8e7b56df" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="8c4e69f8-5074-42c0-8134-0b2429c4c02c"
/dev/sdb1: SEC_TYPE="msdos" UUID="4848-E35A" TYPE="vfat"

tester for HID devices

I have built my own USB HID device. I want to check, if it is working correctly.
I want to check the descriptors sent by the device, display input reports and send output reports. What tools are capable of this task and runs on Windows 7 64 bit?
On a day-to-day basis I use USBlyzer. It works well on Windows 7 64-bit.
As far as free tools go, the Windows DDK includes (in C:\winddk\7600.16385.1\tools\avstream\amd64) a tool called UVCview.exe ("USB device viewer") that shows at least some descriptor information.
You might also try Wireshark, but I admit, I only use it for network and can't speak to the quality of its USB capture.
(even though it's an old post) - here is a convenient and free solution:
Our Docklight Scripting software can test custom USB HID devices in the free (evaluation) download already, no time limit. Tested both on Windows 7 and Windows 10. You can access your device via the chosen VID and PID, display input report data and send output reports, even with variable output report ids.