void CWorkstationInformation::Copy( WKSTA_INFO_102 *source ) { ASSERT( source != NULL ); if ( source == NULL ) { m_Initialize(); return; } #if ! defined( UNICODE ) ::UNICODE_to_ASCII( (LPCWSTR) source->wki102_computername, source->wki102_computername ); ::UNICODE_to_ASCII( (LPCWSTR) source->wki102_langroup, source->wki102_langroup ); ::UNICODE_to_ASCII( (LPCWSTR) source->wki102_lanroot, source->wki102_lanroot ); #endif PlatformID = source->wki102_platform_id; ComputerName = source->wki102_computername; LANGroup = source->wki102_langroup; MajorVersion = source->wki102_ver_major; MinorVersion = source->wki102_ver_minor; LANRoot = source->wki102_lanroot; NumberOfLoggedOnUsers = source->wki102_logged_on_users; #if ! defined( UNICODE ) ::ASCII_to_UNICODE( source->wki102_computername, (LPWSTR) source->wki102_computername ); ::ASCII_to_UNICODE( source->wki102_langroup, (LPWSTR) source->wki102_langroup ); ::ASCII_to_UNICODE( source->wki102_lanroot, (LPWSTR) source->wki102_lanroot ); #endif }
void CWorkstationTransport::Copy( WKSTA_TRANSPORT_INFO_0 *source ) { ASSERT( source != NULL ); if ( source == NULL ) { m_Initialize(); return; } #if ! defined( UNICODE ) ::UNICODE_to_ASCII( (LPCWSTR) source->wkti0_transport_name, source->wkti0_transport_name ); ::UNICODE_to_ASCII( (LPCWSTR) source->wkti0_transport_address, source->wkti0_transport_address ); #endif QualityOfService = source->wkti0_quality_of_service; NumberOfVirtualCircuits = source->wkti0_number_of_vcs; Name = source->wkti0_transport_name; Address = source->wkti0_transport_address; WANish = source->wkti0_wan_ish; #if ! defined( UNICODE ) ::ASCII_to_UNICODE( source->wkti0_transport_name, (LPWSTR) source->wkti0_transport_name ); ::ASCII_to_UNICODE( source->wkti0_transport_address, (LPWSTR) source->wkti0_transport_address ); #endif }
BOOL CRegistry::Close(void) { // Thanks go to Gareth Isaac ([email protected]) for finding a resource leak here if (m_KeyHandle != (HKEY) NULL) { ::RegCloseKey(m_KeyHandle); m_KeyHandle = (HKEY) NULL; } if (m_RegistryHandle == (HKEY) NULL) { return(TRUE); } m_ErrorCode = ::RegCloseKey(m_RegistryHandle); if (m_ErrorCode == ERROR_SUCCESS) { m_RegistryHandle = (HKEY) NULL; m_Initialize(); return(TRUE); } else { return(FALSE); } }
void CNetworkShareInformation::Copy( SHARE_INFO_2 *source ) { ASSERT( source != NULL ); if ( source == NULL ) { m_Initialize(); return; } #if ! defined( UNICODE ) ::UNICODE_to_ASCII( (LPCWSTR) source->shi2_netname, source->shi2_netname ); ::UNICODE_to_ASCII( (LPCWSTR) source->shi2_remark, source->shi2_remark ); ::UNICODE_to_ASCII( (LPCWSTR) source->shi2_path, source->shi2_path ); ::UNICODE_to_ASCII( (LPCWSTR) source->shi2_passwd, source->shi2_passwd ); #endif NetworkName = source->shi2_netname; Type = source->shi2_type; Remark = source->shi2_remark; Permissions = source->shi2_permissions; MaximumNumberOfUses = source->shi2_max_uses; CurrentNumberOfUses = source->shi2_current_uses; PathName = source->shi2_path; Password = source->shi2_passwd; #if ! defined( UNICODE ) ::ASCII_to_UNICODE( source->shi2_netname, (LPWSTR) source->shi2_netname ); ::ASCII_to_UNICODE( source->shi2_remark, (LPWSTR) source->shi2_remark ); ::ASCII_to_UNICODE( source->shi2_path, (LPWSTR) source->shi2_path ); ::ASCII_to_UNICODE( source->shi2_passwd, (LPWSTR) source->shi2_passwd ); #endif }
void CWorkstationUser::Copy( WKSTA_USER_INFO_1 *source ) { ASSERT( source != NULL ); if ( source == NULL ) { m_Initialize(); return; } #if ! defined( UNICODE ) ::UNICODE_to_ASCII( (LPCWSTR) source->wkui1_username, source->wkui1_username ); ::UNICODE_to_ASCII( (LPCWSTR) source->wkui1_logon_domain, source->wkui1_logon_domain ); ::UNICODE_to_ASCII( (LPCWSTR) source->wkui1_oth_domains, source->wkui1_oth_domains ); ::UNICODE_to_ASCII( (LPCWSTR) source->wkui1_logon_server, source->wkui1_logon_server ); #endif UserName = source->wkui1_username; LogonDomain = source->wkui1_logon_domain; OtherDomains = source->wkui1_oth_domains; LogonServer = source->wkui1_logon_server; #if ! defined( UNICODE ) ::ASCII_to_UNICODE( source->wkui1_username, (LPWSTR) source->wkui1_username ); ::ASCII_to_UNICODE( source->wkui1_logon_domain, (LPWSTR) source->wkui1_logon_domain ); ::ASCII_to_UNICODE( source->wkui1_oth_domains, (LPWSTR) source->wkui1_oth_domains ); ::ASCII_to_UNICODE( source->wkui1_logon_server, (LPWSTR) source->wkui1_logon_server ); #endif }
CRegistry::~CRegistry() { if (m_RegistryHandle != (HKEY) NULL) { Close(); } m_Initialize(); }
CNetworkResources::~CNetworkResources() { if ( m_ResumeHandle != NULL ) { ::WNetCloseEnum( m_ResumeHandle ); m_ResumeHandle = NULL; } m_Initialize(); }
void CNetworkResourceInformation::Copy( const NETRESOURCE *source ) { ASSERT( source != NULL ); if ( source == NULL ) { m_Initialize(); return; } if ( source->lpLocalName != (LPTSTR) NULL ) { LocalName = source->lpLocalName; } else { LocalName.Empty(); } if ( source->lpRemoteName != (LPTSTR) NULL ) { RemoteName = source->lpRemoteName; } else { RemoteName.Empty(); } if ( source->lpComment != (LPTSTR) NULL ) { Comment = source->lpComment; } else { Comment.Empty(); } if ( source->lpProvider != (LPTSTR) NULL ) { Provider = source->lpProvider; } else { Provider.Empty(); } Scope = source->dwScope; Type = source->dwType; DisplayType = source->dwDisplayType; Usage = source->dwUsage; }
CWorkstationUser::~CWorkstationUser() { m_Initialize(); }
CNetWorkstation::CNetWorkstation( LPCTSTR machine_name ) { m_Initialize(); Open( machine_name ); }
CNetworkShares::CNetworkShares( LPCTSTR machine_name ) { m_Initialize(); Open( machine_name ); }
void CNetworkResourceInformation::Empty( void ) { m_Initialize(); }
CNetworkShareInformation::~CNetworkShareInformation() { m_Initialize(); }
CEarth::CEarth( ELLIPSOID ellipsoid_identifier ) { m_Initialize(); SetEllipsoid( ellipsoid_identifier ); }
CWorkstationInformation::~CWorkstationInformation() { m_Initialize(); }
void CWorkstationUser::Empty( void ) { m_Initialize(); }
CRegistry::CRegistry() { m_Initialize(); }
CEarth::~CEarth() { m_Initialize(); }
CListeningSocket::CListeningSocket() { TRACE( "CListeningSocket::CListeningSocket()\n" ); m_Initialize(); }
CNetworkShares::~CNetworkShares() { Close(); m_Initialize(); }
CEarth::CEarth( const CEarth& source ) { m_Initialize(); Copy( source ); }
void CWorkstationInformation::Empty( void ) { m_Initialize(); }
void CEarth::SetEllipsoid(ELLIPSOID ellipsoid_identifier ) { m_EllipsoidID = ellipsoid_identifier; switch( ellipsoid_identifier ) { case Perfect_Sphere: m_EquatorialRadiusInMeters = 6378137.0; m_PolarRadiusInMeters = 6378137.0; break; case Airy: m_EquatorialRadiusInMeters = 6377563.396; m_PolarRadiusInMeters = 6356256.909237; break; case Austrailian_National: m_EquatorialRadiusInMeters = 6378160.0; m_PolarRadiusInMeters = 6356774.719195; break; case Bessell_1841: m_EquatorialRadiusInMeters = 6377397.155; m_PolarRadiusInMeters = 6356078.962818; break; case Bessel_1841_Nambia: m_EquatorialRadiusInMeters = 6377483.865; m_PolarRadiusInMeters = 6356165.382966; break; case Clarke_1866: m_EquatorialRadiusInMeters = 6378206.4; m_PolarRadiusInMeters = 6356583.799999; break; case Clarke_1880: m_EquatorialRadiusInMeters = 6378249.145; m_PolarRadiusInMeters = 6356514.86955; break; case Everest: m_EquatorialRadiusInMeters = 6377276.345; m_PolarRadiusInMeters = 6356075.41314; break; case Fischer_1960_Mercury: m_EquatorialRadiusInMeters = 6378166.0; m_PolarRadiusInMeters = 6356784.283607; break; case Fischer_1968: m_EquatorialRadiusInMeters = 6378150.0; m_PolarRadiusInMeters = 6356768.337244; break; case GRS_1967: m_EquatorialRadiusInMeters = 6378160.0; m_PolarRadiusInMeters = 6356774.516091; break; case GRS_1980: m_EquatorialRadiusInMeters = 6378137.0; m_PolarRadiusInMeters = 6356752.31414; break; case Helmert_1906: m_EquatorialRadiusInMeters = 6378200.0; m_PolarRadiusInMeters = 6356818.169628; break; case Hough: m_EquatorialRadiusInMeters = 6378270.0; m_PolarRadiusInMeters = 6356794.343434; break; case International: m_EquatorialRadiusInMeters = 6378388.0; m_PolarRadiusInMeters = 6356911.946128; break; case Krassovsky: m_EquatorialRadiusInMeters = 6378245.0; m_PolarRadiusInMeters = 6356863.018773; break; case Modified_Airy: m_EquatorialRadiusInMeters = 6377340.189; m_PolarRadiusInMeters = 6356034.447939; break; case Modified_Everest: m_EquatorialRadiusInMeters = 6377304.063; m_PolarRadiusInMeters = 6356103.038993; break; case Modified_Fischer_1960: m_EquatorialRadiusInMeters = 6378155.0; m_PolarRadiusInMeters = 6356773.320483; break; case South_American_1969: m_EquatorialRadiusInMeters = 6378160.0; m_PolarRadiusInMeters = 6356774.719195; break; case Topex_Poseidon_Pathfinder_ITRF: // Source is http://neptune.gsfc.nasa.gov/~krachlin/corr/refframe.html m_EquatorialRadiusInMeters = 6378136.3; m_PolarRadiusInMeters = 6356751.6005629376; break; case WGS_60: m_EquatorialRadiusInMeters = 6378165.0; m_PolarRadiusInMeters = 6356783.286959; break; case WGS_66: m_EquatorialRadiusInMeters = 6378145.0; m_PolarRadiusInMeters = 6356759.769489; break; case WGS_72: m_EquatorialRadiusInMeters = 6378135.0; m_PolarRadiusInMeters = 6356750.520016; break; case WGS_84: // Computed polar radius from the flattening value specified at // http://acro.harvard.edu/SSA/BGA/wg84figs.html // because it had the most digits after the decimal point. m_EquatorialRadiusInMeters = 6378137.0; m_PolarRadiusInMeters = 6356752.3142451793; break; case Unknown: default: m_EllipsoidID = Unknown; m_Initialize(); return; } m_ComputeFlattening(); m_ComputeEccentricitySquared(); }
CWorkstationTransport::~CWorkstationTransport() { m_Initialize(); }
CNetworkResources::CNetworkResources() { m_Initialize(); }
void CWorkstationTransport::Empty( void ) { m_Initialize(); }
CNetworkResourceInformation::~CNetworkResourceInformation() { m_Initialize(); }
CNetWorkstation::CNetWorkstation() { m_Initialize(); }
CTape::~CTape() { m_Initialize(); }
CNetworkShares::CNetworkShares() { m_Initialize(); }