Posts

Showing posts from May, 2012

Creating disaster recovery documentation

Image
We've noticed a trend in the use of our product XIA Configuration being used to generate documentation to be used as part of a DR plan. XIA Configuration can help plug into the DR plan by providing very detailed and up to date information on your network infrastructure and can help with the recovery of failed servers or redeployment in case of a DR scenario. With the information provided it is sometimes possible to deploy a replacement server more quickly than it's possible to recover the failed server. Information collected that can help with DR includes Disaster Recovery Capabilities IP addressing information User account configuration Networking device configuration Server configuration DHCP server configuration DNS server configuration

DHCP-M Callout API .NET wrapper support for 64bit

Image
We are pleased to announce that our .NET wrapper for the DHCP-M management API has been updated to support running in native x64 mode as well as 32bit and WOW64. The new version is available to download now from the following link http://www.centrel-solutions.com/support/tools.aspx?feature=dhcpapi

DHCP P/Invoke DHCP_IP_ADDRESS issue on 64bit Windows

Image
When using the DHCP-M management protocol from C# you typically define DHCP_IP_ADDRESS as a uint (UInt32) value. This works correctly on 32bit Windows however when using P/Invoke on a 64bit Windows platform with the host application built as either "Any CPU" or "x64" the application does not work as expected for example you receive the error "The specified subnet does not exist on the DHCP server." when calling the method DhcpGetAllOptionValues. This is because on 64bit Windows you must define the DHCP_IP_ADDRESS as a UIntPtr value (for example within the structure DHCP_OPTION_SCOPE_INFO) which changes size when run on a 64bit platform. SubnetScopeInfo = new UIntPtr (SubnetAddress);

Possible Memory Leak. Application has passed a non-NULL pointer to RPC for an [out] parameter.

Image
Automated Network Documentation When calling an unmanaged method the method works correctly when targeted to a 32bit platform however crashes without error on a 64bit system when targeted to “Any CPU” or “x64”. The following message is logged to the Application Event Log: Possible Memory Leak.   Application (“ applicationpath” ) (PID: 6996) has passed a non-NULL pointer to RPC for an [out] parameter marked [allocate(all_nodes)].   [allocate(all_nodes)] parameters are always reallocated; if the original pointer contained the address of valid memory, that memory will be leaked.   The call originated on the interface with UUID ({6bffd098-a112-3610-9833-46c3f874532d}), Method number (2).   User Action: Contact your application vendor for an updated version of the application. This error can be seen when passing a class into an managed method as an out parameter. Ensure that instead the object being passed is defined as a struct.

.NET Runtime version 2.0.50727.5456 - Fatal Execution Engine Error (000007FEF6B27916) (80131506)

Image
Network Audit and Documentation     We've recently been testing our DHCP management API on 64bit platforms and have found that though this works correctly when the application is targeted at x86 it works correctly however when targeted at Any CPU or x64 in release mode the application crashes and the following error is reported to the event log. .NET Runtime version 2.0.50727.5456 - Fatal Execution Engine Error (000007FEF6B27916) (80131506) This error is caused by a data types being incorrectly assigned. As 64bit platforms determine data sizes differentlyit  is important to debug the code and find which unmanaged method or struct is being worked with and review the documentation for that method or struct. In our case we found we had incorrectly used an Integer value in a struct rather than a pointer to an integer. Pointers on 32bit platforms are 32bit however on 64bit platforms they are 64bit so as .NET iterates through objects in an array we were fortun...

Query DHCP using C# .NET

Image
As part of our ongoing commitment to centralise technical documentation we have created a managed C# .NET API wrapper for the Microsoft DHCP management API (DHCPM). This includes a simple user interface to view the configuration data on a local or remote machine For more information please see the following page http://www.centrel-solutions.com/support/tools.aspx?feature=dhcpapi For more information on XIA Configuration and how it can help document your network infrastructure please see http://www.centrel-solutions.com/XIAConfiguration/ Using a managed API over the Resource Kit tool dhcpobjs (dhcpojbs.dll) has several advantages including Support for 32bit and 64bit Support for IPv6 The ability to document new Windows 2008 and above features including NAP configuration The API is currently able to view the following information IPv4 and IPv6 Server information Reservations Leases (currently IPv4 only) Scope Ranges Scope options Exclusions Server defaults ...

P/Invoke DhcpEnumServers from C#

As the first part of our DHCP management API series the following shows the sample code for enumerating authorised DHCP servers in the Active Directory domain. This method runs on the machine where the code is running (not any DHCP server) therefore the caller machine must be connected to Active Directory. /// <summary> /// The DhcpEnumServers function returns an enumerated list of DHCP servers found in the directory service /// </summary> /// <remarks> http://msdn.microsoft.com/en-us/library/windows/desktop/aa813375(v=vs.85).aspx </remarks> [ DllImport ( "dhcpsapi.dll" , SetLastError = true , CharSet = CharSet .Unicode)] protected static extern uint DhcpEnumServers(     uint Flags,     IntPtr IdInfo,     out IntPtr Servers,     IntPtr CallbackFn,     IntPtr CallbackData );   /// <summary> /// Returns an enumerated list ...

Product: Microsoft Network Monitor 3.4 -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action BindDriver, location: C:\Program Files\Microsoft Network Monitor 3\, command: "C:\Program Files\Microsoft Network Monitor 3\nmconfig.exe"

When installing NetMon 3.4 earlier today I had a strange error on test Windows Server 2008 R2 Virtual Machine. Product: Microsoft Network Monitor 3.4 -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action BindDriver, location: C:\Program Files\Microsoft Network Monitor 3\, command: "C:\Program Files\Microsoft Network Monitor 3\nmconfig.exe" /install S-1-5-21-4060388796-979203389-4127277286-500 After immediately blaming UAC and several other troublesome technologies I found that the issue was that I had downloaded the installer to the root of C: as netmon.exe. Renaming the installer to anything other than netmon.exe and rerunning the installation solved the issue.