Skip to content

Commit 015f7a8

Browse files
Fix BID Test
Fixed the test for whether the BID Trace registry keys were set already.
1 parent 5d260d5 commit 015f7a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

SQLTrace/SQLTrace.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ LogRaw "
8989
/_______ /\_____\ \_/|_______ \|____| |__| (____ / \___ >\___ >
9090
\/ \__> \/ \/ \/ \/
9191
92-
SQLTrace.ps1 version 1.0.0.0065
92+
SQLTrace.ps1 version 1.0.0.0066
9393
by the Microsoft SQL Server Networking Team
9494
"
9595

@@ -307,21 +307,21 @@ Function SetupBIDRegistry
307307

308308
Function HasBIDBeenSet
309309
{
310-
$BIDPath = "HKLM:\Software\WOW6432Node\Microsoft\BidInterface\Loader"
310+
$BIDPath = "HKLM:\Software\Microsoft\BidInterface\Loader"
311311
$BID32Path = "HKLM:\Software\WOW6432Node\Microsoft\BidInterface\Loader"
312312

313313
# 32-bit test
314314
if ($global:INISettings.BidWow -eq "Only" -or $global:INISettings.BidWow -eq "Both")
315315
{
316-
$Path = Get-ItemProperty $BID32Path -Name ":Path"
316+
$Path = Get-ItemProperty $BID32Path -Name ":Path" -ErrorAction SilentlyContinue # $Path will be $null if :Path does not exist
317317
if ($Path -eq $null) { return $false }
318318
if ($Path.":Path" -ne "MSDADIAG.DLL") { return $false } # case insensitive comparison
319319
}
320320

321321
# 64-bit test
322322
if ($global:INISettings.BidWow -eq "Both" -or $global:INISettings.BidWow -eq "No")
323323
{
324-
$Path = Get-ItemProperty $BIDPath -Name ":Path"
324+
$Path = Get-ItemProperty $BIDPath -Name ":Path" -ErrorAction SilentlyContinue # $Path will be $null if :Path does not exist
325325
if ($Path -eq $null) { return $false }
326326
if ($Path.":Path" -ne "MSDADIAG.DLL") { return $false } # case insensitive comparison
327327
}

0 commit comments

Comments
 (0)