Subversion Repositories filter_foundry

Rev

Rev 550 | Rev 553 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 550 Rev 552
Line 330... Line 330...
330
                        // This is a temporary gdata structure just for the About dialog!
330
                        // This is a temporary gdata structure just for the About dialog!
331
                        // Not to be confused with the "real" gdata during the filter invocation (containing more data).
331
                        // Not to be confused with the "real" gdata during the filter invocation (containing more data).
332
                        gdata = (globals_t*)malloc(sizeof(globals_t));
332
                        gdata = (globals_t*)malloc(sizeof(globals_t));
333
                        if (!gdata) break;
333
                        if (!gdata) break;
334
                        gdata->hWndMainDlg = (HWND)((PlatformData*)((AboutRecordPtr)pb)->platformData)->hwnd; // so that simplealert() works
334
                        gdata->hWndMainDlg = (HWND)((PlatformData*)((AboutRecordPtr)pb)->platformData)->hwnd; // so that simplealert() works
335
                        parmReadOk = readPARMresource((HMODULE)hDllInstance, NULL);
335
                        parmReadOk = (0 == readPARMresource((HMODULE)hDllInstance));
336
                        if (!parmReadOk) gdata->parm.standalone = false;
336
                        if (!parmReadOk) gdata->parm.standalone = false;
337
                        if (parmReadOk && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) {
337
                        if (parmReadOk && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) {
338
                                parm_reset(true, true, true, true);
338
                                parm_reset(true, true, true, true);
339
                                if (gdata->obfusc) {
339
                                if (gdata->obfusc) {
340
                                        simplealert_id(MSG_INCOMPATIBLE_OBFUSCATION_ID);
340
                                        simplealert_id(MSG_INCOMPATIBLE_OBFUSCATION_ID);
Line 564... Line 564...
564
 
564
 
565
                sfr.sfGood = true;
565
                sfr.sfGood = true;
566
                sfr.sfReplacing = true;
566
                sfr.sfReplacing = true;
567
                sfr.sfType = PS_FILTER_FILETYPE;
567
                sfr.sfType = PS_FILTER_FILETYPE;
568
 
568
 
569
                parmReadOk = readPARMresource((HMODULE)hDllInstance, NULL);
569
                parmReadOk = (0 == readPARMresource((HMODULE)hDllInstance));
570
                if (!parmReadOk) gdata->parm.standalone = false;
570
                if (!parmReadOk) gdata->parm.standalone = false;
571
                if (parmReadOk && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) {
571
                if (parmReadOk && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) {
572
                        parm_reset(true, true, true, true);
572
                        parm_reset(true, true, true, true);
573
                        if (gdata->obfusc) {
573
                        if (gdata->obfusc) {
574
                                simplealert_id(MSG_INCOMPATIBLE_OBFUSCATION_ID);
574
                                simplealert_id(MSG_INCOMPATIBLE_OBFUSCATION_ID);
Line 589... Line 589...
589
 
589
 
590
                if (parmReadOk) {
590
                if (parmReadOk) {
591
                        tmpState = saveInternalState();
591
                        tmpState = saveInternalState();
592
                }
592
                }
593
 
593
 
594
                if (loadfile(&sfr, NULL)) {
594
                if (0 == loadfile(&sfr)) {
595
                        if (parmReadOk) {
595
                        if (parmReadOk) {
596
                                // In the standalone filter, we only want the parameters (ctl,map) in the temporary .afs file, not the formulas
596
                                // In the standalone filter, we only want the parameters (ctl,map) in the temporary .afs file, not the formulas
597
                                // We do not need to care about the metadata, because the AFS does not touch the metadata anyway
597
                                // We do not need to care about the metadata, because the AFS does not touch the metadata anyway
598
                                for (i = 0; i < 4; i++) {
598
                                for (i = 0; i < 4; i++) {
599
                                        strcpy(bakexpr[i], gdata->parm.szFormula[i]);
599
                                        strcpy(bakexpr[i], gdata->parm.szFormula[i]);
Line 606... Line 606...
606
 
606
 
607
                        return true;
607
                        return true;
608
                }
608
                }
609
        }
609
        }
610
 
610
 
611
        if( (bUninitializedParams = !(params && readparams_afs_pff(params, NULL))) ){
611
        if( (bUninitializedParams = !(params && (0 == readparams_afs_pff(params)))) ){
612
                /* either the parameter handle was uninitialised,
612
                /* either the parameter handle was uninitialised,
613
                   or the parameter data couldn't be read; set default values */
613
                   or the parameter data couldn't be read; set default values */
614
 
614
 
615
                Boolean parmReadOk;
615
                Boolean parmReadOk;
616
 
616
 
617
                // see if saved parameters exist
617
                // see if saved parameters exist
618
                parmReadOk = readPARMresource((HMODULE)hDllInstance, NULL);
618
                parmReadOk = (0 == readPARMresource((HMODULE)hDllInstance));
619
                if (!parmReadOk) gdata->parm.standalone = false;
619
                if (!parmReadOk) gdata->parm.standalone = false;
620
                if (parmReadOk && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) {
620
                if (parmReadOk && (gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) {
621
                        parm_reset(true, true, true, true);
621
                        parm_reset(true, true, true, true);
622
                        if (gdata->obfusc) {
622
                        if (gdata->obfusc) {
623
                                simplealert_id(MSG_INCOMPATIBLE_OBFUSCATION_ID);
623
                                simplealert_id(MSG_INCOMPATIBLE_OBFUSCATION_ID);