diff --git a/rtl/wince/system.pp b/rtl/wince/system.pp index 8cfb438bbb..bd0a7e4a8a 100644 --- a/rtl/wince/system.pp +++ b/rtl/wince/system.pp @@ -506,8 +506,12 @@ function CreateEvent(lpEventAttributes:pointer;bManualReset:longbool;bInitialSta var buf: array[0..MaxPathLen] of WideChar; begin - AnsiToWideBuf(lpName, -1, buf, SizeOf(buf)); - CreateEvent := CreateEventW(lpEventAttributes, bManualReset, bInitialState, buf); + if lpName=nil then + CreateEvent := CreateEventW(lpEventAttributes, bManualReset, bInitialState, nil) + else begin + AnsiToWideBuf(lpName, -1, buf, SizeOf(buf)); + CreateEvent := CreateEventW(lpEventAttributes, bManualReset, bInitialState, buf); + end; end; function EventModify(h: THandle; func: DWORD): LONGBOOL;