WINSOCK Error 10013 in ICMPPort, Ping, and Traceroute Components


WINSOCK error 10013 (WSAEACCES - Permission Denied) occurs because access to raw sockets is denied to non-administrator users on Windows NT 4.0 and Windows 2000 systems.

This issue affects applications that use the ICMPPort, Ping, or Traceroute components, which rely on raw sockets, and can be addressed in one of the following ways:

  1. Set the UseICMPDLL config property to true.
  2. Modify the operating system settings to allow non-administrator users to access raw sockets.

Microsoft Explanation of the Issue

Microsoft documents this behavior in article Q195445: PRB: "RAW Socket Access Denied to Non-Admin Windows NT 4.0 and Windows 2000 Users."

The information in this article applies to: Microsoft Win32 Software Development Kit (SDK), used with: Microsoft Windows NT 4.0 SP4 Microsoft Windows 2000

IMPORTANT

This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

Symptoms and Cause

A Socket or WSASocket call that specifies the SOCK_RAW socket type fails with WINSOCK error 10013 (WSAEACCES) when a non-administrator user is logged on to a Windows NT 4.0 or Windows 2000 system; this behavior is by design.

Resolution

  • Windows 2000: There is no way to disable this security check. Access to Raw Sockets is granted on a per-transport basis. For the address family AF_INET, only administrators have the access necessary to create Raw Sockets.

  • Windows NT 4.0: You can disable the security check on raw sockets by creating the following registry value and setting it to DWORD 1:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Afd\Parameters\DisableRawSecurity

After modifying the registry, you must restart the computer.

WARNING

Editing the Windows registry incorrectly can cause serious system problems that may require reinstalling the operating system. Always back up the registry before making changes. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note: That you should back up the registry before you edit it. If you are running Windows NT, you should also update your Emergency Repair Disk (ERD).

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.