Skip to content

Commit 09633d0

Browse files
committed
Prepare for release. Disable non-production things.
1 parent b6ca06a commit 09633d0

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

SarAsio/dllmain.cpp

+14-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with SynchronousAudioRouter. If not, see <http://www.gnu.org/licenses/>.
1616

17+
// Microsoft thinks getenv is insecure, presumably because setenv/putenv are not
18+
// thread safe? I think it's going to be ok.
19+
#define _CRT_SECURE_NO_WARNINGS
20+
1721
#include "stdafx.h"
1822
#include "dllmain.h"
1923
#include "utility.h"
@@ -28,10 +32,16 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD reason, LPVOID reserved)
2832
FLAGS_log_dir = Sar::LoggingPath();
2933
FLAGS_logbuflevel = -1;
3034

31-
GetModuleFileNameA(nullptr, buf, 1024);
32-
google::InitGoogleLogging(
33-
*buf ? _strdup(PathFindFileNameA(buf)) : "SarAsio");
34-
LOG(INFO) << "Initializing SarAsio.";
35+
char *sarLogVar = getenv("SAR_ASIO_LOG");
36+
37+
if (sarLogVar && atoi(sarLogVar)) {
38+
GetModuleFileNameA(nullptr, buf, 1024);
39+
google::InitGoogleLogging(
40+
*buf ? _strdup(PathFindFileNameA(buf)) : "SarAsio");
41+
LOG(INFO) << "Initializing SarAsio.";
42+
} else {
43+
LOG(INFO) << "Logging disabled. (This shouldn't log.)";
44+
}
3545
}
3646

3747
gDllModule = hModule;

SarInstaller/Product.wxs

+6
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,28 @@
6161
Execute="deferred"
6262
Impersonate="no"
6363
Return="check"/>
64+
<!--
6465
<CustomAction Id="InstallNdisFilter"
6566
BinaryKey="SarInstallerActions"
6667
DllEntry="InstallNdisFilter"
6768
Execute="deferred"
6869
Impersonate="no"
6970
Return="check"/>
71+
-->
7072
<CustomAction Id="RemoveDeviceNode"
7173
BinaryKey="SarInstallerActions"
7274
DllEntry="RemoveDeviceNode"
7375
Execute="deferred"
7476
Impersonate="no"
7577
Return="check"/>
78+
<!--
7679
<CustomAction Id="UninstallNdisFilter"
7780
BinaryKey="SarInstallerActions"
7881
DllEntry="UninstallNdisFilter"
7982
Execute="deferred"
8083
Impersonate="no"
8184
Return="check"/>
85+
-->
8286

8387
<InstallExecuteSequence>
8488
<Custom Action="CreateDeviceNode.SetProperty" After="InstallFiles">
@@ -87,12 +91,14 @@
8791
<Custom Action="CreateDeviceNode" After="CreateDeviceNode.SetProperty">
8892
NOT Installed AND NOT REMOVE
8993
</Custom>
94+
<!-- Disabled until NDIS driver is mature.
9095
<Custom Action="InstallNdisFilter" After="MsiProcessDrivers">
9196
NOT Installed AND NOT REMOVE
9297
</Custom>
9398
<Custom Action="UninstallNdisFilter" Before="MsiProcessDrivers">
9499
REMOVE
95100
</Custom>
101+
-->
96102
<Custom Action="RemoveDeviceNode" Before="RemoveFiles">
97103
REMOVE
98104
</Custom>

0 commit comments

Comments
 (0)