Skip to content

Commit 7731f11

Browse files
author
bytecode77
committed
Bugfix: Installation fails when notebook unplugged
1 parent 054eacd commit 7731f11

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

$Examples/ControlPipe.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// This example demonstrates how to make r77 perform a ShellExecute.
44
// All other control codes work similarly.
55

6-
#define CONTROL_USER_SHELLEXEC 0x3001 // These constants can be found in r77api.h or in the technical documentation
6+
#define CONTROL_USER_SHELLEXEC 0x3001 // These constants can be found in r77def.h or in the technical documentation
77

88
int main()
99
{

Helper/Helper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ int ProcessList()
114114
{
115115
GetProcessIntegrityLevel(process, &integrityLevel);
116116

117-
if (!GetProcessUserName(process, userName, &userNameLength))userName[0] = L'\0';
117+
if (!GetProcessUserName(process, userName, &userNameLength)) userName[0] = L'\0';
118118

119119
CloseHandle(process);
120120
}

r77api/r77win.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ BOOL CreateScheduledTask(LPCWSTR name, LPCWSTR directory, LPCWSTR fileName, LPCW
452452
ITaskSettings *settings = NULL;
453453
if (SUCCEEDED(task->lpVtbl->get_Settings(task, &settings)))
454454
{
455-
if (SUCCEEDED(settings->lpVtbl->put_StartWhenAvailable(settings, VARIANT_TRUE)))
455+
if (SUCCEEDED(settings->lpVtbl->put_StartWhenAvailable(settings, VARIANT_TRUE)) &&
456+
SUCCEEDED(settings->lpVtbl->put_DisallowStartIfOnBatteries(settings, VARIANT_FALSE)))
456457
{
457458
ITriggerCollection *triggerCollection = NULL;
458459
if (SUCCEEDED(task->lpVtbl->get_Triggers(task, &triggerCollection)))

0 commit comments

Comments
 (0)