@@ -50,9 +50,9 @@ public EventWaitHandle(bool initialState, EventResetMode mode, string name)
5050#if PLATFORM_UNIX
5151 throw new PlatformNotSupportedException ( SR . PlatformNotSupported_NamedSynchronizationPrimitives ) ;
5252#else
53- if ( System . IO . Path . MaxPath < name . Length )
53+ if ( Interop . Kernel32 . MAX_PATH < name . Length )
5454 {
55- throw new ArgumentException ( SR . Format ( SR . Argument_WaitHandleNameTooLong , name , Path . MaxPath ) , nameof ( name ) ) ;
55+ throw new ArgumentException ( SR . Format ( SR . Argument_WaitHandleNameTooLong , name , Interop . Kernel32 . MAX_PATH ) , nameof ( name ) ) ;
5656 }
5757#endif
5858 }
@@ -98,9 +98,9 @@ internal unsafe EventWaitHandle(bool initialState, EventResetMode mode, string n
9898#if PLATFORM_UNIX
9999 throw new PlatformNotSupportedException ( SR . PlatformNotSupported_NamedSynchronizationPrimitives ) ;
100100#else
101- if ( System . IO . Path . MaxPath < name . Length )
101+ if ( Interop . Kernel32 . MAX_PATH < name . Length )
102102 {
103- throw new ArgumentException ( SR . Format ( SR . Argument_WaitHandleNameTooLong , name , Path . MaxPath ) , nameof ( name ) ) ;
103+ throw new ArgumentException ( SR . Format ( SR . Argument_WaitHandleNameTooLong , name , Interop . Kernel32 . MAX_PATH ) , nameof ( name ) ) ;
104104 }
105105#endif
106106 }
@@ -184,9 +184,9 @@ private static OpenExistingResult OpenExistingWorker(string name, EventWaitHandl
184184 throw new ArgumentException ( SR . Argument_EmptyName , nameof ( name ) ) ;
185185 }
186186
187- if ( null != name && System . IO . Path . MaxPath < name . Length )
187+ if ( null != name && Interop . Kernel32 . MAX_PATH < name . Length )
188188 {
189- throw new ArgumentException ( SR . Format ( SR . Argument_WaitHandleNameTooLong , name , Path . MaxPath ) , nameof ( name ) ) ;
189+ throw new ArgumentException ( SR . Format ( SR . Argument_WaitHandleNameTooLong , name , Interop . Kernel32 . MAX_PATH ) , nameof ( name ) ) ;
190190 }
191191
192192
0 commit comments