I am using some unmanaged code like-
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState(out int Description, int ReservedValue);
//Creating a function that uses the API function...
public static bool IsConnectedToInternet() {
int Desc;
return InternetGetConnectedState(out Desc, 0);
}
Any suggestions on how I can dispose/cleanup this extern static object when I call Dispose?
The thing you think is an 'extern static object' is not an object at all, it's just a set of instructions to the compiler/runtime about how to find a function in a DLL.
As Sander says, there's nothing to clean up.