Skip to content

Commit

Permalink
Bugfix: Installation fails when notebook unplugged
Browse files Browse the repository at this point in the history
  • Loading branch information
bytecode77 committed Jun 6, 2023
1 parent 054eacd commit 7731f11
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion $Examples/ControlPipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This example demonstrates how to make r77 perform a ShellExecute.
// All other control codes work similarly.

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

int main()
{
Expand Down
2 changes: 1 addition & 1 deletion Helper/Helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int ProcessList()
{
GetProcessIntegrityLevel(process, &integrityLevel);

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

CloseHandle(process);
}
Expand Down
3 changes: 2 additions & 1 deletion r77api/r77win.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@ BOOL CreateScheduledTask(LPCWSTR name, LPCWSTR directory, LPCWSTR fileName, LPCW
ITaskSettings *settings = NULL;
if (SUCCEEDED(task->lpVtbl->get_Settings(task, &settings)))
{
if (SUCCEEDED(settings->lpVtbl->put_StartWhenAvailable(settings, VARIANT_TRUE)))
if (SUCCEEDED(settings->lpVtbl->put_StartWhenAvailable(settings, VARIANT_TRUE)) &&
SUCCEEDED(settings->lpVtbl->put_DisallowStartIfOnBatteries(settings, VARIANT_FALSE)))
{
ITriggerCollection *triggerCollection = NULL;
if (SUCCEEDED(task->lpVtbl->get_Triggers(task, &triggerCollection)))
Expand Down

0 comments on commit 7731f11

Please sign in to comment.