I've the same problem as you on a Windows XP-SP2 system with Pelles C 4.50. The problem comes from Pelles C itself (since version 4.50) in the
WizAddProjectFileA module and not from Windows. With the previous version of Pelles C (4.0), there is no problem.
Here some additional informations obtained with the Microsoft Windows Debugger:
ModLoad: 5ad70000 5ada8000 C:\WINDOWS\system32\UxTheme.dll
ModLoad: 10000000 1002c000 C:\Program Files\PellesC\Bin\Intl\rsrc0009.dll
ModLoad: 77c00000 77c08000 C:\WINDOWS\system32\VERSION.dll
ModLoad: 03c90000 03cc0000 C:\PROGRA~1\BABYLO~1\CAPTLIB.DLL
ModLoad: 732e0000 732e5000 C:\WINDOWS\system32\riched32.dll
ModLoad: 74e30000 74e9c000 C:\WINDOWS\system32\RICHED20.dll
ModLoad: 040e0000 040f1000 C:\Program Files\PellesC\Bin\Wizards\conapp.dll
ModLoad: 040e0000 040f6000 C:\Program Files\PellesC\Bin\Wizards\custcntl.dll
ModLoad: 040e0000 040f7000 C:\Program Files\PellesC\Bin\Wizards\msvcproj.dll
ModLoad: 040e0000 040f6000 C:\Program Files\PellesC\Bin\Wizards\winapp.dll
ModLoad: 040e0000 040f4000 C:\Program Files\PellesC\Bin\Wizards\windll.dll
(c58.b2c): Invalid handle - code c0000008 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=c0000008 ebx=01ace0c4 ecx=043bff68 edx=7c90eb3d esi=00000000 edi=00000001
eip=7c90eb74 esp=043bff14 ebp=043bff64 iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000206
ntdll!KiRaiseUserExceptionDispatcher+0x37:
7c90eb74 8b0424 mov eax,[esp] ss:0023:043bff14=c0000008
______________________________________________________________________
Call stack:
043bff64 7c90eb94 ntdll!KiRaiseUserExceptionDispatcher+0x37
043bff78 004aee77 ntdll!KiFastSystemCallRet
043bffb4 7c80b683
poide!WizAddProjectFileA+0xa02c7
043bffec 00000000 kernel32!GetModuleFileNameA+0x1b4
______________________________________________________________________
ntdll!KiRaiseUserExceptionDispatcher:
7c90eb3d 55 push ebp
7c90eb3e 8bec mov ebp,esp
7c90eb40 83ec50 sub esp,0x50
7c90eb43 8944240c mov [esp+0xc],eax
7c90eb47 64a118000000 mov eax,fs:[00000018]
7c90eb4d 8b80a4010000 mov eax,[eax+0x1a4]
7c90eb53 890424 mov [esp],eax
7c90eb56 c744240400000000 mov dword ptr [esp+0x4],0x0
7c90eb5e c744240800000000 mov dword ptr [esp+0x8],0x0
7c90eb66 c744241000000000 mov dword ptr [esp+0x10],0x0
7c90eb6e 54 push esp
7c90eb6f e838000000 call ntdll!RtlRaiseException (7c90ebac)
7c90eb74 8b0424 mov eax,[esp] ss:0023:043bff14=c0000008
7c90eb77 8be5 mov esp,ebp
7c90eb79 5d pop ebp
7c90eb7a c3 ret
7c90eb7b 90 nop
7c90eb7c 8da42400000000 lea esp,[esp]
7c90eb83 8d4900 lea ecx,[ecx]
7c90eb86 90 nop
7c90eb87 90 nop
7c90eb88 90 nop
7c90eb89 90 nop
7c90eb8a 90 nop
ntdll!KiFastSystemCall:
7c90eb8b 8bd4 mov edx,esp
______________________________________________________________________
7c80b64c 6a10 push 0x10
7c80b64e 6890b6807c push 0x7c80b690
7c80b653 e86e6effff call kernel32!ReleaseMutex+0x1f (7c8024c6)
7c80b658 8365fc00 and dword ptr [ebp-0x4],0x0
7c80b65c 64a118000000 mov eax,fs:[00000018]
7c80b662 8945e0 mov [ebp-0x20],eax
7c80b665 817810001e0000 cmp dword ptr [eax+0x10],0x1e00
7c80b66c 750f jnz kernel32!GetModuleFileNameA+0x1ae (7c80b67d)
7c80b66e 803d0840887c00 cmp byte ptr [kernel32!SetConsoleMaximumWindowSize+0x4dc6 (7c884008)],0x0
7c80b675 7506 jnz kernel32!GetModuleFileNameA+0x1ae (7c80b67d)
7c80b677 ff15e812807c call dword ptr [kernel32+0x12e8 (7c8012e8)]
7c80b67d ff750c push dword ptr [ebp+0xc]
7c80b680 ff5508 call dword ptr [ebp+0x8]
7c80b683 50 push eax
7c80b684 e8cf090000 call kernel32!ExitThread (7c80c058)
7c80b689 90 nop
7c80b68a 90 nop
7c80b68b 90 nop
7c80b68c 90 nop
7c80b68d 90 nop
7c80b68e 90 nop
7c80b68f 90 nop
7c80b690 ffff
7c80b692 ffff
7c80b694 10ab837c26ab adc [ebx+0xab267c83],ch
7c80b69a 837c909090 cmp dword ptr [eax+edx*4-0x70],0xffffff90
7c80b69f 90 nop
______________________________________________________________________