135,7 → 135,7 |
} |
*/ |
|
simplealert((TCHAR*)TEXT("You tried to execute this DLL with RunDLL32. This is a Photoshop plugin!")); |
simplealert((TCHAR*)TEXT("You tried to execute this method with RunDLL32. This is a Photoshop plugin!")); |
return; |
} |
|
247,6 → 247,7 |
void ENTRYPOINT(short selector, FilterRecordPtr pb, intptr_t *data, short *result){ |
static Boolean wantdialog = false; |
static Boolean premiereWarnedOnce = false; |
OSErr e = noErr; |
char *reason; |
|
#ifdef SHOW_HOST_DEBUG |
266,10 → 267,6 |
EnterCodeResource(); |
|
#ifdef WIN_ENV |
activationContextUsed = ActivateManifest((HMODULE)hDllInstance, 1, &manifestVars); |
#endif |
|
#ifdef WIN_ENV |
if ((intptr_t)result == SW_SHOWDEFAULT) { |
// When the 8BF file is analyzed with VirusTotal.com, it will invoke each |
// exported function by calling |
297,12 → 294,8 |
// otherwise we have a problem here! |
// I don't understand why this works! Aren't we __cdecl and rundll expected __stdcall? But why is the parameter order correct and not reversed? |
FakeRundll32((HWND)(intptr_t)selector, (HINSTANCE)pb, (LPSTR)data, (int)(intptr_t)result); |
goto endmain; |
return; |
} |
else { |
// will be changed if an error happens |
*result = noErr; |
} |
#endif |
|
#ifdef SHOW_HOST_DEBUG |
322,7 → 315,7 |
} |
premiereWarnedOnce = true; |
*result = errPlugInHostInsufficient; |
goto endmain; |
return; |
} |
|
#ifdef DEBUG_SIMULATE_GIMP |
330,7 → 323,7 |
pb->parameters = pb->handleProcs->newProc(1); |
#endif |
|
gpb = pb; // required for CreateDataPointer() |
gpb = pb; |
|
if (selector != filterSelectorAbout && !*data) { |
// The filter was never called before. We allocate (zeroed) memory now. |
338,12 → 331,16 |
CreateDataPointer(data); |
if (!*data) { |
*result = memFullErr; |
goto endmain; |
return; |
} |
} |
|
gdata = (globals_t*)*data; |
|
#ifdef WIN_ENV |
activationContextUsed = ActivateManifest((HMODULE)hDllInstance, 1, &manifestVars); |
#endif |
|
nplanes = MIN(pb->planes,4); |
|
switch (selector){ |
394,7 → 391,7 |
pb->parameters = PINEWHANDLE(1); // don't set initial size to 0, since some hosts (e.g. GIMP/PSPI) are incompatible with that. |
|
if (!pb->parameters) { |
*result = memFullErr; |
e = memFullErr; |
} |
else |
{ |
457,30 → 454,30 |
} |
} |
else |
*result = userCanceledErr; |
e = userCanceledErr; |
} |
wantdialog = false; |
} |
|
if(*result == noErr){ |
if(e == noErr){ |
if(setup(pb)){ |
DoStart(pb); |
}else{ |
*result = filterBadParameters; |
e = filterBadParameters; |
} |
} |
break; |
case filterSelectorContinue: |
*result = DoContinue(pb); |
e = DoContinue(pb); |
break; |
case filterSelectorFinish: |
DoFinish(pb); |
break; |
default: |
*result = filterBadParameters; |
e = filterBadParameters; |
} |
|
endmain: |
*result = e; |
|
// TODO: Question: Is that OK to call this every invocation, or should it be only around UI stuff? |
#ifdef WIN_ENV |