Subversion Repositories filter_foundry

Rev

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

Rev 445 Rev 454
Line 31... Line 31...
31
extern HINSTANCE hDllInstance;
31
extern HINSTANCE hDllInstance;
32
 
32
 
33
Boolean doresources(FSSpec* dst, int bits);
33
Boolean doresources(FSSpec* dst, int bits);
34
 
34
 
35
void dbglasterror(TCHAR *func){
35
void dbglasterror(TCHAR *func){
36
        TCHAR s[0x300];
36
        TCHAR s[0x300] = {0};
37
 
37
 
38
        xstrcpy(&s[0],func);
38
        xstrcpy(&s[0],func);
39
        xstrcat(&s[0],TEXT(" failed: "));
39
        xstrcat(&s[0],TEXT(" failed: "));
40
        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - xstrlen(s), NULL);
40
        FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - (DWORD)xstrlen(s), NULL);
41
        dbg(&s[0]);
41
        dbg(&s[0]);
42
}
42
}
43
 
43
 
44
/*
44
/*
45
BOOL CALLBACK enumfunc(HMODULE hModule,LPCTSTR lpszType,LPCTSTR lpszName,WORD wIDLanguage,LONG lParam){
45
BOOL CALLBACK enumfunc(HMODULE hModule,LPCTSTR lpszType,LPCTSTR lpszName,WORD wIDLanguage,LONG lParam){
Line 50... Line 50...
50
        return TRUE;
50
        return TRUE;
51
}
51
}
52
*/
52
*/
53
 
53
 
54
int domanifest(char *newmanifest, char *manifestp, PARM_T* pparm, int bits) {
54
int domanifest(char *newmanifest, char *manifestp, PARM_T* pparm, int bits) {
55
        char name[1024];
55
        char name[1024] = { 0 };
56
        char description[1024];
56
        char description[1024] = { 0 };
57
        size_t i;
57
        size_t i;
58
        size_t iname = 0;
58
        size_t iname = 0;
59
        int idescription = 0;
59
        int idescription = 0;
60
 
60
 
61
        // Description
61
        // Description
Line 439... Line 439...
439
                        && (manifestp = (Ptr)LockResource(manifesth)) )
439
                        && (manifestp = (Ptr)LockResource(manifesth)) )
440
                {
440
                {
441
                        char* newmanifest;
441
                        char* newmanifest;
442
                        int manifestsize = SizeofResource(hDllInstance, manifestsrc);
442
                        int manifestsize = SizeofResource(hDllInstance, manifestsrc);
443
 
443
 
444
                        newmanifest = (char*)malloc(manifestsize + 4096/*+4KiB for name,description,etc.*/);
444
                        newmanifest = (char*)malloc((size_t)manifestsize + 4096/*+4KiB for name,description,etc.*/);
445
 
445
 
446
                        DBG("loaded DATA, PiPL");
446
                        DBG("loaded DATA, PiPL");
447
 
447
 
448
                        strcpy(title,gdata->parm.szTitle);
448
                        strcpy(title,gdata->parm.szTitle);
449
                        if(gdata->parm.popDialog)
449
                        if(gdata->parm.popDialog)
Line 469... Line 469...
469
                                /* Generate 'aete' resource (contains names of the parameters for the "Actions" tab in Photoshop) */
469
                                /* Generate 'aete' resource (contains names of the parameters for the "Actions" tab in Photoshop) */
470
                                aetesize = aete_generate(newaete, pparm, event_id);
470
                                aetesize = aete_generate(newaete, pparm, event_id);
471
 
471
 
472
                                // ====== Create fitting manifest for the activation context
472
                                // ====== Create fitting manifest for the activation context
473
 
473
 
474
                                manifestp_copy = (char*)malloc(manifestsize + 1/*sz*/);
474
                                manifestp_copy = (char*)malloc((size_t)manifestsize + 1/*sz*/);
475
                                if (manifestp_copy != 0) {
475
                                if (manifestp_copy != 0) {
476
                                        memcpy(manifestp_copy, manifestp, manifestsize); // copy manifestp to manifestp_copy, because manifestp is readonly
476
                                        memcpy(manifestp_copy, manifestp, manifestsize); // copy manifestp to manifestp_copy, because manifestp is readonly
477
                                        manifestp_copy[manifestsize] = '\0'; // and add the null-terminating char, because domanifest() uses sprintf() on it
477
                                        manifestp_copy[manifestsize] = '\0'; // and add the null-terminating char, because domanifest() uses sprintf() on it
478
                                        manifestsize = domanifest(newmanifest, manifestp_copy, pparm, bits);
478
                                        manifestsize = domanifest(newmanifest, manifestp_copy, pparm, bits);
479
                                        free(manifestp_copy);
479
                                        free(manifestp_copy);
Line 693... Line 693...
693
        return res ? noErr : ioErr;
693
        return res ? noErr : ioErr;
694
}
694
}
695
 
695
 
696
OSErr make_standalone(StandardFileReply *sfr){
696
OSErr make_standalone(StandardFileReply *sfr){
697
        OSErr tmpErr, outErr;
697
        OSErr tmpErr, outErr;
698
        FSSpec dst;
698
        FSSpec dst = { 0 };
699
 
699
 
700
        outErr = noErr;
700
        outErr = noErr;
701
 
701
 
702
        // Make 32 bit:
702
        // Make 32 bit:
703
        // Destfile = no64_or_32(chosenname)
703
        // Destfile = no64_or_32(chosenname)