Skip to content

Commit f70a360

Browse files
committed
fix a bug where the progress bar may display the wrong percentage loaded
1 parent f348c9f commit f70a360

File tree

6 files changed

+82
-12
lines changed

6 files changed

+82
-12
lines changed

FlashpointSecurePlayer/CustomSecurityManager.cs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ int InternetInterfaces.IInternetSecurityManager.GetSecuritySite(out IntPtr pSite
6464
return INET_E_DEFAULT_ACTION;
6565
}
6666

67-
int InternetInterfaces.IInternetSecurityManager.MapUrlToZone([MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, ref uint pdwZone, uint dwFlags) {
67+
int InternetInterfaces.IInternetSecurityManager.MapUrlToZone(
68+
[MarshalAs(UnmanagedType.LPWStr)]
69+
string pwszUrl,
70+
71+
ref uint pdwZone,
72+
uint dwFlags
73+
) {
6874
// behave like local intranet
6975
pdwZone = 1;
7076

@@ -104,11 +110,31 @@ int InternetInterfaces.IInternetSecurityManager.MapUrlToZone([MarshalAs(Unmanage
104110
return S_OK;
105111
}
106112

107-
int InternetInterfaces.IInternetSecurityManager.GetSecurityId([MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, [MarshalAs(UnmanagedType.LPArray)] byte[] pbSecurityId, ref uint pcbSecurityId, uint dwReserved) {
113+
int InternetInterfaces.IInternetSecurityManager.GetSecurityId(
114+
[MarshalAs(UnmanagedType.LPWStr)]
115+
string pwszUrl,
116+
117+
[MarshalAs(UnmanagedType.LPArray)]
118+
byte[] pbSecurityId,
119+
120+
ref uint pcbSecurityId,
121+
uint dwReserved
122+
) {
108123
return INET_E_DEFAULT_ACTION;
109124
}
110125

111-
int InternetInterfaces.IInternetSecurityManager.ProcessUrlAction([MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, uint dwAction, ref uint pPolicy, uint cbPolicy, IntPtr pContext, uint cbContext, uint dwFlags, uint dwReserved) {
126+
int InternetInterfaces.IInternetSecurityManager.ProcessUrlAction(
127+
[MarshalAs(UnmanagedType.LPWStr)]
128+
string pwszUrl,
129+
130+
uint dwAction,
131+
ref uint pPolicy,
132+
uint cbPolicy,
133+
IntPtr pContext,
134+
uint cbContext,
135+
uint dwFlags,
136+
uint dwReserved
137+
) {
112138
if (cbPolicy < Marshal.SizeOf(pPolicy.GetType())) {
113139
return S_FALSE;
114140
}

FlashpointSecurePlayer/InternetInterfaces.cs

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,19 +254,60 @@ public interface IInternetSecurityManager {
254254
int GetSecuritySite(out IntPtr pSite);
255255

256256
[PreserveSig]
257-
int MapUrlToZone([MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, ref uint pdwZone, uint dwFlags);
257+
int MapUrlToZone(
258+
[MarshalAs(UnmanagedType.LPWStr)]
259+
string pwszUrl,
260+
261+
ref uint pdwZone,
262+
uint dwFlags
263+
);
258264

259265
[PreserveSig]
260-
int GetSecurityId([MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, [MarshalAs(UnmanagedType.LPArray)] byte[] pbSecurityId, ref uint pcbSecurityId, uint dwReserved);
266+
int GetSecurityId(
267+
[MarshalAs(UnmanagedType.LPWStr)]
268+
string pwszUrl,
269+
270+
[MarshalAs(UnmanagedType.LPArray)] byte[] pbSecurityId,
271+
ref uint pcbSecurityId,
272+
uint dwReserved
273+
);
261274

262275
[PreserveSig]
263-
int ProcessUrlAction([MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, uint dwAction, ref uint pPolicy, uint cbPolicy, IntPtr pContext, uint cbContext, uint dwFlags, uint dwReserved);
276+
int ProcessUrlAction(
277+
[MarshalAs(UnmanagedType.LPWStr)]
278+
string pwszUrl,
279+
280+
uint dwAction,
281+
ref uint pPolicy,
282+
uint cbPolicy,
283+
IntPtr pContext,
284+
uint cbContext,
285+
uint dwFlags,
286+
uint dwReserved
287+
);
264288

265289
[PreserveSig]
266-
int QueryCustomPolicy([MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, ref Guid guidKey, ref byte ppPolicy, ref uint pcbPolicy, ref byte pContext, uint cbContext, uint dwReserved);
290+
int QueryCustomPolicy(
291+
[MarshalAs(UnmanagedType.LPWStr)]
292+
string pwszUrl,
293+
294+
ref Guid guidKey,
295+
ref byte ppPolicy,
296+
ref uint pcbPolicy,
297+
ref byte pContext,
298+
uint cbContext,
299+
uint dwReserved
300+
);
267301

268302
[PreserveSig]
269-
int SetZoneMapping(uint dwZone, [MarshalAs(UnmanagedType.LPWStr)] string lpszPattern, uint dwFlags);
303+
int SetZoneMapping(
304+
uint dwZone,
305+
306+
[MarshalAs(UnmanagedType.LPWStr)]
307+
string lpszPattern,
308+
309+
uint dwFlags
310+
);
270311

271312
[PreserveSig]
272313
int GetZoneMappings(uint dwZone, out IEnumString ppenumString, uint dwFlags);

FlashpointSecurePlayer/ProgressManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,9 @@ private static void Show() {
300300
double reciprocal = 1;
301301
double multiplier = 0;
302302

303-
for (int i = 0; i < goalsArray.Length; i++) {
304-
for (int j = 0; j < i; j++) {
303+
// this MUST loop backwards
304+
for (int i = goalsArray.Length - 1; i >= 0; i--) {
305+
for (int j = goalsArray.Length - 1; j > i; j--) {
305306
size = goalsArray[j].Size;
306307

307308
if (size == 0) {

FlashpointSecurePlayer/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("2.2.2.0")]
37-
[assembly: AssemblyFileVersion("2.2.2.0")]
36+
[assembly: AssemblyVersion("2.2.3.0")]
37+
[assembly: AssemblyFileVersion("2.2.3.0")]
3838
[assembly: NeutralResourcesLanguage("en")]
3939

FlashpointSecurePlayer/Shared.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public static void LogExceptionToLauncher(Exception ex) {
164164
public const int WM_LBUTTONDOWN = 0x00000201;
165165
public const int WM_RBUTTONDOWN = 0x00000204;
166166
public const int WM_MBUTTONDOWN = 0x00000207;
167+
public const int WM_XBUTTONDOWN = 0x0000020B;
167168
public const int WM_XBUTTONUP = 0x0000020C;
168169
public const int WM_PARENTNOTIFY = 0x00000210;
169170

FlashpointSecurePlayer/WebBrowserMode.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ public bool PreFilterMessage(ref Message m) {
279279
case WM_LBUTTONDOWN:
280280
case WM_RBUTTONDOWN:
281281
case WM_MBUTTONDOWN:
282+
case WM_XBUTTONDOWN:
282283
// these are intended to always return false
283284
OnStopExitFullscreenLabelTimer(EventArgs.Empty);
284285
return false;

0 commit comments

Comments
 (0)