This is my current Code:
[Version]
Signature="$WINDOWS NT$"
Class=%ClassName%
ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171}
Provider=%ProviderName%
CatalogFile=hidriver.cat
DriverVer=01/07/2018
PnpLockdown = 1
[SourceDisksNames]
1=%DiskName%,,,
[SourceDisksFiles]
hidriver.sys=1
[DestinationDirs]
DefaultDestDir=12
[Manufacturer]
%ManufacturerName%=Microsoft,NT$ARCH$.6.1
[Microsoft.NT$ARCH$.6.1]
%DeviceName%=DefaultInstall,root\hidriver
[DefaultInstall.NT]
CopyFiles=Files
[Files]
hidriver.sys
[DefaultInstall.NT.HW]
AddReg=HWAddReg
[HWAddReg]
HKR,,"LowerFilters",0x00010008,"hidriver"
[DefaultInstall.NT.Services]
AddService=hidriver,0x00000000,hidriverService
AddService=mshidkmdf,0x00000002,mshidkmdfService
[hidriverService]
DisplayName=%ServiceName%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\hidriver.sys
[mshidkmdfService]
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\mshidkmdf.sys
[DefaultInstall.NT.Wdf]
KmdfService=hidriver,KmdfLibrary
[KmdfLibrary]
KmdfLibraryVersion=$KMDFVERSION$
[Strings]
DeviceName="VARIABLE_1"
DiskName="VARIABLE_2"
ProviderName="VARIABLE_3"
ManufacturerName="VARIABLE_4"
ServiceName="VARIABLE_5"
ClassName="VARIABLE_6"
Visual Studio is throwing these errors:
1280 Class name and ClassGuid mismatch, expecting Class "Sample" for ClassGuid "{78A1C341-4539-11d3-B88D-00C04FAD5171}".
1212 Cannot have both [Manufacturer] and [DefaultInstall] sections.
How can i solve these errors?
Related
I have a Powershell function that formats out put from another function I have to gather version, path and file information based on some registry queries. It seems all the data is being stored to one variable and only printing one line altogether. Below is my code, the output and an explanation of what I need in the desired output.
Code:
function getOffice()
{
$list = new-object System.Collections.Generic.List[PSCustomObject];
$found_paths = #();
$final_paths = #();
$uninstall_keys = getRegistrySubkeys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" '\\Office[\d+.*]';
if ($uninstall_keys -ne $null)
{
foreach ($key in $uninstall_keys)
{
$product_name = getRegistryValue $key "DisplayName";
$version = getRegistryValue $key "DisplayVersion";
$base_install_path = getRegistryValue $key "InstallLocation";
$full_install_path = (Get-ChildItem -Directory -LiteralPath $base_install_path | Where-Object Name -match '^Office\d{1,2}\D?').FullName;
$found_paths += ,$full_install_path;
$exes = #("MSOCF.DLL", "access.exe", "word.exe", "wordCnv.exe", "WordViewer.exe", "Excel.exe", "ExcelCnv.exe", "ExcelViewer.exe", "PowerPoint.exe",
"PowerPointViewer.exe", "PowerPointCnv.exe", "Publisher.exe", "Project.exe", "OneNote.exe", "InfoPath.exe Groove.exe", "FrontPage.exe",
"SharePointDesigner.exe", "Visio.exe", "VisioViewer.exe", "Lync.exeOutlook.exe", "WINPROJ.EXE");
foreach($path in $found_paths)
{
foreach($exe in $exes)
{
$found_files = Get-Item ([System.IO.Path]::Combine($path, $exe)) -EA Ignore;
$found_file = $found_files.Name;
if ($found_file)
{
$office = makeFileResult $found_file, $path, $version, $product_name, $version;
$list.Add($office);
$list
}
}
}
}
}
}
function makeFileResult($name, $path, $file_version, $product_name, $product_version)
{
return [PSCustomObject]#{
path = $path;
file = $name;
product_version = $product_version;
product_name = $product_name;
file_version = $file_version;
};
}
getOffice
Output:
path :
file : {MSOCF.DLL, C:\Program Files\Microsoft Office\Office15, 15.0.4569.1506, Microsoft Project Standard 2013...}
product_version :
product_name :
file_version :
path :
file : {WINPROJ.EXE, C:\Program Files\Microsoft Office\Office15, 15.0.4569.1506, Microsoft Project Standard 2013...}
product_version :
product_name :
file_version :
path :
file : {MSOCF.DLL, C:\Program Files\Microsoft Office\Office15, 15.0.4569.1506, Microsoft Project Standard 2013...}
product_version :
product_name :
file_version :
path :
file : {WINPROJ.EXE, C:\Program Files\Microsoft Office\Office15, 15.0.4569.1506, Microsoft Project Standard 2013...}
product_version :
product_name :
file_version :
I am not sure why all the data is only being stored in the `file` key here.
I am not sure why all the data is only being stored in the file key here.
Desired Output:
path : C:\Program Files\Microsoft Office\Office15
file : MSOCF.DLL
product_version : 15.0.4569.1506
product_name : Microsoft Project Standard 2013
file_version : 15.0.4569.1506
path : C:\Program Files\Microsoft Office\Office15
file : WINPROJ.EXE
product_version : 15.0.4569.1506
product_name : Microsoft Project Standard 2013
file_version : 15.0.4569.1506
Seems silly, but remove the commas and only have spaces when making the function call makeFileResult.
$office = makeFileResult $found_file $path $version $product_name $version
Since the parameters in the function call have no type defined, PowerShell will do it's best to "guess" what type you mean. The commas in between the variables end up being interpreted as a string array instead of a string like you are expecting. You can see this when you get the type:
PS C:\> $office.file.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Object[] System.Array
The spaces make the function call be evaluated like a traditional cmd call, with the Arg[] string array.
I personally would read about advanced Parameters and add named parameters which would make it easier to make sure everything gets logged in a consistent way.
How can I find the value of "is connected" for a Bluetooth device? I've tried Get-WMIObject cmdlets and a few others but none of the values changed when I connect/disconnect. The only place I have found the value to change is in the attached image. I found it in the Device Properties for the Bluetooth Headset I am trying to use.
I'm trying to write a toggle script for AutoHotKey to send btcom commands, but I would like to write an if statement with that. The piece I'm missing here is finding the value of "is connected" on my Bluetooth device.
Example of output from Get-WMIObject:
PS H:\> Get-WmiObject -Query "select * from win32_PnPEntity where Caption='Jordan's AirPods Pro'"
__GENUS : 2
__CLASS : Win32_PnPEntity
__SUPERCLASS : CIM_LogicalDevice
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : Win32_PnPEntity.DeviceID="BTHENUM\\DEV_14C88BC438FE\\7&2D1C6A81&0&BLUETOOTHDEVICE_14C88BC438FE"
__PROPERTY_COUNT : 26
__DERIVATION : {CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER : OL-2TK93103QK
__NAMESPACE : root\cimv2
__PATH : \\OL-2TK93103QK\root\cimv2:Win32_PnPEntity.DeviceID="BTHENUM\\DEV_14C88BC438FE\\7&2D1C6A81&0&BLUETOOTHDEVICE_14C88BC438FE"
Availability :
Caption : Jordan’s AirPods Pro
ClassGuid : {e0cbf06c-cd8b-4647-bb8a-263b43f0f974}
CompatibleID : {BTHENUM\GENERIC_DEVICE}
ConfigManagerErrorCode : 0
ConfigManagerUserConfig : False
CreationClassName : Win32_PnPEntity
Description : Bluetooth Device
DeviceID : BTHENUM\DEV_14C88BC438FE\7&2D1C6A81&0&BLUETOOTHDEVICE_14C88BC438FE
ErrorCleared :
ErrorDescription :
HardwareID : {BTHENUM\Dev_14C88BC438FE}
InstallDate :
LastErrorCode :
Manufacturer : Microsoft
Name : Jordan’s AirPods Pro
PNPClass : Bluetooth
PNPDeviceID : BTHENUM\DEV_14C88BC438FE\7&2D1C6A81&0&BLUETOOTHDEVICE_14C88BC438FE
PowerManagementCapabilities :
PowerManagementSupported :
Present : True
Service :
Status : OK
StatusInfo :
SystemCreationClassName : Win32_ComputerSystem
SystemName : OL-2TK93103QK
PSComputerName : OL-2TK93103QK
PS H:\>
I would like to replace all non capitalised words in a text with "-".length of the word.
For instance I have the following Text (German):
Florian Homm wuchs als Sohn des mittelständischen Handwerksunternehmers Joachim Homm und seiner Frau Maria-Barbara „Uschi“ Homm im hessischen Bad Homburg vor der Höhe auf. Sein Großonkel mütterlicherseits war der Unternehmer Josef Neckermann. Nach einem Studium an der Harvard University, das er mit einem Master of Business Administration an der Harvard Business School abschloss, begann Homm seine Tätigkeit in der US-amerikanischen Finanzwirtschaft bei der Investmentbank Merrill Lynch, danach war er bei dem US-Fondsanbieter Fidelity Investments, der Schweizer Privatbank Julius Bär und dem US-Vermögensverwalter Tweedy Browne....
should be transformed into
Florian Homm ---- --- Sohn --- ------------ Handwerksunternehmers Joachim Homm --- ------ Frau Maria-Barbara „Uschi“ Homm -- ---------- Bad Homburg --- Höhe ---. ....
▶ input.gsub(/\p{L}+/) { |m| m[0] != m[0].upcase ? '-'*m.length : m }
#⇒ "Florian Homm ----- --- Sohn --- ------------------ Handwerksunternehmers..."
More clean solution (credits to Cary):
▶ input.gsub(/(?<!\p{L})\p{Lower}+(?!\p{L})/) { |m| '-' * m.length }
Try something like this
s.split.map { |word| ('A'..'Z').include?(word[0]) ? word : '-' * word.length }.join(' ')
You can try something like this for small input size:
Basically, I:
Split the input string on whitespace character
Map the array to either the word itself (if not capitalized) or the word replaced with dashes (if capitalized)
join with whitespaces.
Like so
s = "Florian Homm wuchs als Sohn des mittelständischen Handwerksunternehmers Joachim Homm und seiner Frau Maria-Barbara „Uschi“ Homm im hessischen Bad Homburg vor der Höhe auf. Sein Großonkel mütterlicherseits war der Unternehmer Josef Neckermann. Nach einem Studium an der Harvard University, das er mit einem Master of Business Administration an der Harvard Business School abschloss, begann Homm seine Tätigkeit in der US-amerikanischen Finanzwirtschaft bei der Investmentbank Merrill Lynch, danach war er bei dem US-Fondsanbieter Fidelity Investments, der Schweizer Privatbank Julius Bär und dem US-Vermögensverwalter Tweedy Browne...."
s.split(/[[:space:]]/).map { |word| word.capitalize == word ? word : '-' * word.length }.join(' ')
Does that apply to your problem?
Cheers!
Edit: For a more memory efficient solution you can use regex replace gsub, check out this other answer by mudasobwa https://stackoverflow.com/a/41570686/4411941
r = /
(?<![[:alpha:]]) # do not match a letter (negative lookbehind)
[[:lower:]] # match a lowercase letter
[[:alpha:]]* # match zero or more letters
/x # free-spacing regex definition mode
str = "Frau Maria-Barbara „Uschi“ Homm im hessischen Bad Homburg vor der Höhe auf."
str.gsub(r) { |m| '-'*m.size }
#=> "Frau Maria-Barbara „Uschi“ Homm -- ---------- Bad Homburg --- --- Höhe ---."
"die Richter/-innen".gsub(r) { |m| '-'*m.size }
#=> "--- Richter/------"
"Jede(r) Anwältin und Anwalt".gsub(r) { |m| '-'*m.size }
#=> "Jede(-) Anwältin --- Anwalt"
Solution
This problem is harder than it looks!
This code might be more memory hungry than others, but I dare say it works for a wider range of (weird) German words :
def hide_non_capitalized(text)
text.split(/[[:space:]]/).map do |chars|
first_letter = chars[/[[:alpha:]]/]
if first_letter && first_letter == first_letter.downcase
## Keep non-letters :
chars.gsub(/[[:alpha:]]/,'-')
## Replace every character :
# '-' * chars.size
else
chars
end
end.join(' ')
end
It splits the text into character blocks, and replaces all the letters of a block if its first letter is lowercase. This code requires Ruby 2.4, because 'ä'.upcase is still 'ä' up to Ruby 2.3.
Test
puts hide_non_capitalized(text)
#=> Florian Homm ----- --- Sohn --- ----------------- Handwerksunternehmers Joachim Homm --- ------ Frau Maria-Barbara „Uschi“ Homm -- ---------- Bad Homburg --- --- Höhe ---. Sein Großonkel ----------------- --- --- Unternehmer Josef Neckermann. Nach ----- Studium -- --- Harvard University, --- -- --- ----- Master -- Business Administration -- --- Harvard Business School ---------, ------ Homm ----- Tätigkeit -- --- US-amerikanischen Finanzwirtschaft --- --- Investmentbank Merrill Lynch, ------ --- -- --- --- US-Fondsanbieter Fidelity Investments, --- Schweizer Privatbank Julius Bär --- --- US-Vermögensverwalter Tweedy Browne....
hide_none = "Änderung. „Uschi“, Attaché-case Maria-Barbara US-Fondsanbieter. Die Richter/-innen. Jede(r) 1234 \"#+?\""
puts hide_non_capitalized(hide_none)
#=> Änderung. „Uschi“, Attaché-case Maria-Barbara US-Fondsanbieter. Die Richter/-innen. Jede(r) 1234 "#+?"
hide_all = "öfters. „word“ lowercase-Uppercase jede(r) not/exactly/a/word"
puts hide_non_capitalized(hide_all)
#=> ------. „----“ ------------------- ----(-) ---/-------/-/----
I'm porting a Xilinx ISE project to Quartus II. When I compile that project Quartus crashes with an error: *** Fatal Error: Access Violation at 0X000007FE88160DE1. So I'm trying to narrow down the error to a minimal example, which will guide me to a hidden VHDL bug or to a small example, which I can send to Altera.
The project uses a VHDL data structure (record of vectors of records of vectors of ... of basic types) to describe a SoC setup. The simplified structure look like this:
SoFPGA System
o-DeviceInstances
| o-Device
| o-Registers
| | o-Bitfields
| o-RegisterMappings
o-Busses
I would like to report the full structure to the synthesis log, but Quartus II seems to hide messages if the message text was already printed to the log.
Example:
Info (10635): ... at pb.pkg.vhdl(1228): "DeviceInstance 1:" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1229): " DeviceInstance: Mult32" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1230): " Device: Mult32" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1234): " 0: OperandA0 Reg#=0 WR" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1241): " 0: FieldID=0 (OperandA)" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1234): " 1: OperandA1 Reg#=1 WR" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1234): " 2: OperandA2 Reg#=2 WR" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1234): " 3: OperandA3 Reg#=3 WR" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1234): " 4: OperandB0 Reg#=4 WR" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1241): " 0: FieldID=1 (OperandB)" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1234): " 5: OperandB1 Reg#=5 WR" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1234): " 6: OperandB2 Reg#=6 WR" (NOTE)
Info (10635): ... at pb.pkg.vhdl(1234): " 7: OperandB3 Reg#=7 WR" (NOTE)
The 'FieldID' message is only printed once per 'Operand[A|B]'. There is no FieldID line after operands A1, A2, A3 and B1, B2, B3.
So I tried to add an unique number (salt) to each report line. For that I defined a shared variable and defined a function salty that increments salt in every report statement.
Variable and function:
shared variable salt : NATURAL := 0;
impure function salty return STRING is
begin
salt := salt + 1;
return INTEGER'image(salt);
end function;
Usage:
report salty & "pb_CreateRegisterRO:" severity NOTE;
But unfortunately, salty always returns "0". Quartus II supports VHDL'08 features. Should I implement the shared variable as a protected type and compile it in VHDL'08 mode?
How can I print all report statement lines to the synthesis report?
Off topic question:
Is someone interested in helping me finding the reason why Quartus crashes? I stripped the project to 6 VHDL files. I think this problem is to specific for a SO question. Contact
At MSDN Installing a Filter Driver there is a sample file given (reproduced lower).
In the [upperfilter_addreg] section there is the registry line HKR,,"UpperFilters",0x00010008,"upperfilt".
What is the meaning of the 0x00010008 flag ?
Note that this file is meant to install an Upper Filter Driver.
Thank you microsoft for your great resourceful complete docs.
:
[DestinationDirs]
upperfilter_copyfiles = 12
[upperfilter_inst]
CopyFiles = upperfilter_copyfiles
AddReg = upperfilter_addreg
[upperfilter_copyfiles]
upperfilt.sys
[upperfilter_addreg]
; append this service to existing REG_MULTI_SZ list, if any
HKR,,"UpperFilters",0x00010008,"upperfilt"
[upperfilter_inst.Services]
AddService = upperfilt,,upperfilter_service
[upperfilter_service]
DisplayName = %upperfilter_ServiceDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\upperfilt.sys
:
See the help in the WDK.
Should be
FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND
so more its what is supplied in the comment in the line above the AddReg directive itself.