Skip to content

Commit

Permalink
1.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Oct 21, 2023
1 parent d31aa80 commit 1f5ba40
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 30 deletions.
40 changes: 26 additions & 14 deletions Sandboxie/apps/start/aboutdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,21 +307,33 @@ bool DoAboutDialog(bool bReminder)
if (Days < 40)
return true;

int Interval;
if (Days > 730) Interval = 5 * 24;
else if (Days > 365) Interval = 10 * 24;
else if (Days > 180) Interval = 20 * 24;
else Interval = 30 * 24;

USHORT ReminderShedule[2*11];
if (NT_SUCCESS(SbieApi_Call(API_GET_SECURE_PARAM, 3, L"ReminderShedule", (ULONG_PTR)&ReminderShedule, sizeof(ReminderShedule)))) {
for (USHORT* Cur = ReminderShedule; (ULONG_PTR)Cur < (ULONG_PTR)ReminderShedule + sizeof(ReminderShedule) && *Cur != 0; Cur += 2) {
if (Days > Cur[0]) {
if (Cur[1] < Interval) Interval = Cur[1];
break;
}
}
int Interval = 30 * 24; // in hours

USHORT ReminderShedule[2 * 11] = {
// days, itnerval,
730, 1 * 24,
365, 5 * 24,
182, 10 * 24,
30, 30 * 24,
0
};
USHORT CurReminderRevision = 1;

USHORT ReminderRevision = 0;
SbieApi_Call(API_GET_SECURE_PARAM, 3, L"ReminderRevision", (ULONG_PTR)&ReminderRevision, sizeof(ReminderRevision));
if (ReminderRevision < CurReminderRevision) {
SbieApi_Call(API_SET_SECURE_PARAM, 3, L"ReminderShedule", (ULONG_PTR)&ReminderShedule, sizeof(ReminderShedule));
SbieApi_Call(API_SET_SECURE_PARAM, 3, L"ReminderRevision", (ULONG_PTR)&ReminderRevision, sizeof(ReminderRevision));
}
else if (ReminderRevision > CurReminderRevision)
SbieApi_Call(API_GET_SECURE_PARAM, 3, L"ReminderShedule", (ULONG_PTR)&ReminderShedule, sizeof(ReminderShedule));

for (USHORT* Cur = ReminderShedule; (ULONG_PTR)Cur < (ULONG_PTR)ReminderShedule + sizeof(ReminderShedule) && *Cur != 0; Cur += 2) {
if (Days > Cur[0]) {
if (Cur[1] < Interval) Interval = Cur[1];
break;
}
}

time_t LastReminder = 0;
SbieApi_Call(API_GET_SECURE_PARAM, 3, L"LastReminder", (ULONG_PTR)&LastReminder, sizeof(LastReminder));
Expand Down
41 changes: 25 additions & 16 deletions SandboxiePlus/SandMan/Windows/SupportDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,31 @@ bool CSupportDialog::CheckSupport(bool bOnRun)
{
// Note: the old sandboxie showed a message after 30 days every 12 hours for 5 seconds

int Interval;
if (Days > 730) Interval = 5 * 24;
else if (Days > 365) Interval = 10 * 24;
else if (Days > 180) Interval = 20 * 24;
else Interval = 30 * 24;

//USHORT ReminderRevision = 0;
//theAPI->GetSecureParam("ReminderRevision", &ReminderRevision, sizeof(ReminderRevision));

USHORT ReminderShedule[2*11];
if (theAPI->GetSecureParam("ReminderShedule", &ReminderShedule, sizeof(ReminderShedule))) {
for (USHORT* Cur = ReminderShedule; (ULONG_PTR)Cur < (ULONG_PTR)ReminderShedule + sizeof(ReminderShedule) && *Cur != 0; Cur += 2) {
if (Days > Cur[0]) {
if (Cur[1] < Interval) Interval = Cur[1];
break;
}
int Interval = 30 * 24; // in hours

USHORT ReminderShedule[2 * 11] = {
// days, itnerval,
730, 1 * 24,
365, 5 * 24,
182, 10 * 24,
30, 30 * 24,
0
};
USHORT CurReminderRevision = 1;

USHORT ReminderRevision = 0;
theAPI->GetSecureParam("ReminderRevision", &ReminderRevision, sizeof(ReminderRevision));
if (ReminderRevision < CurReminderRevision) {
theAPI->SetSecureParam("ReminderShedule", &ReminderShedule, sizeof(ReminderShedule));
theAPI->SetSecureParam("ReminderRevision", &CurReminderRevision, sizeof(CurReminderRevision));
}
else if (ReminderRevision > CurReminderRevision)
theAPI->GetSecureParam("ReminderShedule", &ReminderShedule, sizeof(ReminderShedule));

for (USHORT* Cur = ReminderShedule; (ULONG_PTR)Cur < (ULONG_PTR)ReminderShedule + sizeof(ReminderShedule) && *Cur != 0; Cur += 2) {
if (Days > Cur[0]) {
if (Cur[1] < Interval) Interval = Cur[1];
break;
}
}

Expand Down

0 comments on commit 1f5ba40

Please sign in to comment.