using System.Runtime.InteropServices;

namespace ZuneUI
{
	public struct HRESULT
	{
		public int hr;

		public int Int => hr;

		public bool IsSuccess
		{
			[return: MarshalAs(UnmanagedType.U1)]
			get
			{
				return (byte)((hr >= 0) ? 1u : 0u) != 0;
			}
		}

		public bool IsError
		{
			[return: MarshalAs(UnmanagedType.U1)]
			get
			{
				return hr < 0;
			}
		}

		public HRESULT(int hr)
		{
			this.hr = hr;
		}

		[return: MarshalAs(UnmanagedType.U1)]
		public static bool operator ==(HRESULT hrA, HRESULT hrB)
		{
			return hrA.hr == hrB.hr;
		}

		[return: MarshalAs(UnmanagedType.U1)]
		public static bool operator !=(HRESULT hrA, HRESULT hrB)
		{
			return (byte)((hrA.hr != hrB.hr) ? 1u : 0u) != 0;
		}

		public static implicit operator HRESULT(int hr)
		{
			HRESULT result;
			result.hr = hr;
			return result;
		}

		[return: MarshalAs(UnmanagedType.U1)]
		public override bool Equals(object oCompare)
		{
			int num = ((oCompare is HRESULT && hr == ((HRESULT)oCompare).hr) ? 1 : 0);
			return (byte)num != 0;
		}

		public override int GetHashCode()
		{
			return hr;
		}

		public override string ToString()
		{
			int num = hr;
			return "hr:" + num.ToString("X");
		}

		public static HRESULT _S_OK = new(0);
		public static HRESULT _S_FALSE = new(1);
		public static HRESULT _E_ABORT = new(-2147467260);
		public static HRESULT _E_PENDING = new(-2147483638);
		public static HRESULT _E_FAIL = new(-2147467259);
		public static HRESULT _E_UNEXPECTED = new(-2147418113);
		public static HRESULT _E_ACCESSDENIED = new(-2147024891);
		public static HRESULT _ERROR_SERVICE_DISABLED = new(1058);
		public static HRESULT _NS_E_WMP_UNKNOWN_ERROR = new(-1072885299);
		public static HRESULT _NS_E_WMP_PLAYLIST_IMPORT_ERROR = new(-1072885765);
		public static HRESULT _NS_E_CD_BUSY = new(-1072885764);
		public static HRESULT _E_ALREADY_EXISTS = new(-2147024713);
		public static HRESULT _DB_E_NOTFOUND = new(-2147217895);
		public static HRESULT _DB_E_RESOURCEEXISTS = new(-2147217768);
		public static HRESULT _DB_E_BADPARAMETERNAME = new(-2147217827);
		public static HRESULT _ZUNE_E_NO_AVAILABLE_RESTORE_POINT = new(-1056899026);
		public static HRESULT _NS_E_MTPZ_WLAN_TEST_UNKNOWN = new(-1072887866);
		public static HRESULT _NS_E_MTPZ_WLAN_TEST_RUNNING = new(-1072887865);
		public static HRESULT _NS_E_MTPZ_WLAN_TEST_FAIL_NO_CONFIG = new(-1072887864);
		public static HRESULT _NS_E_MTPZ_WLAN_TEST_FAIL_ASSOCIATE = new(-1072887863);
		public static HRESULT _NS_E_MTPZ_WLAN_TEST_FAIL_DHCP = new(-1072887862);
		public static HRESULT _NS_E_MTPZ_WLAN_TEST_FAIL_TIMEOUT = new(-1072887861);
		public static HRESULT _NS_E_MTPZ_WLAN_TEST_FAIL_CANCELLED = new(-1072887860);
		public static HRESULT _NS_E_MTPZ_WLAN_TEST_FAIL_INTERNAL = new(-1072887859);
		public static HRESULT _ZEST_E_TOO_MANY_DEREGISTRATIONS_WITHIN_MONTH = new(-1056857072);
		public static HRESULT _NS_E_MEDIA_DOWNLOAD_MAXIMUM_EXCEEDED = new(-1072884900);
		public static HRESULT _ZUNE_E_NO_SUBSCRIPTION_DOWNLOAD_RIGHTS = new(-1056899031);
		public static HRESULT _NS_E_MEDIA_NOT_PURCHASED = new(-1072884891);
		public static HRESULT _NS_E_MESSAGING_CLIENT_ERROR = new(-1072885517);
		public static HRESULT _NS_E_MESSAGING_RECIPIENT_ERROR = new(-1072885515);
		public static HRESULT _NS_E_MESSAGING_PARENTAL_CONTROL_ERROR = new(-1072885513);
		public static HRESULT _NS_E_CART_FULL = new(-1072885493);
		public static HRESULT _NS_E_CART_TOO_MANY_NEW_ITEMS = new(-1072885492);
		public static HRESULT _NS_E_CART_MORE_ITEMS_AVAILABLE = new(-2146627315);
		public static HRESULT _NS_E_SIGNIN_TERMS_OF_SERVICE = new(-1072884874);
		public static HRESULT _NS_E_SERVER_ACCESSDENIED = new(-1072877829);
		public static HRESULT _NS_E_PASSPORT_LOGIN_FAILED = new(-1072884892);
		public static HRESULT _NS_E_SUBSCRIPTIONSERVICE_LOGIN_FAILED = new(-1072884897);
		public static HRESULT _NS_E_INVALID_USERNAME_AND_PASSWORD = new(-1072884910);
		public static HRESULT _NS_E_SIGNIN_ACCOUNTS_INVALID_USER = new(-1072884884);
		public static HRESULT _NS_E_SIGNIN_ACCOUNTS_NOT_XENON_USER = new(-1072884882);
		public static HRESULT _NS_E_SIGNIN_WCMUSIC_ACCOUNT_NOT_ELIGIBLE = new(-1072884883);
		public static HRESULT _ZUNE_E_SIGNIN_TERMS_OF_SERVICE_CHILD = new(-1056899049);
		public static HRESULT _NS_E_SIGNIN_INVALID_REGION = new(-1072884909);
		public static HRESULT _ZEST_E_UNAUTHENTICATED = new(-1056858108);
		public static HRESULT _NS_E_SIGNIN_HTTP_GONE = new(-1072885082);
		public static HRESULT _NS_E_BILLING_LIGHTWEIGHT_ACCOUNT = new(-1072885473);
		public static HRESULT _NS_E_FIRMWARE_UPDATE_DISK_FULL = new(-1072885167);
		public static HRESULT _NS_E_WINLIVE_SIGNIN_NAME_TOO_SHORT = new(-1072875780);
		public static HRESULT _NS_E_WINLIVE_SIGNIN_NAME_TOO_LONG = new(-1072875804);
		public static HRESULT _NS_E_WINLIVE_SIGNIN_NAME_INVALID = new(-1072875803);
		public static HRESULT _NS_E_WINLIVE_EMAIL_INVALID = new(-1072875802);
		public static HRESULT _NS_E_WINLIVE_NAME_INVALID = new(-1072875801);
		public static HRESULT _NS_E_WINLIVE_BIRTH_YEAR_INVALID = new(-1072875800);
		public static HRESULT _NS_E_WINLIVE_BIRTH_DAY_INVALID = new(-1072875799);
		public static HRESULT _NS_E_WINLIVE_BIRTH_MONTH_INVALID = new(-1072875798);
		public static HRESULT _NS_E_WINLIVE_BIRTH_DATE_FUTURE = new(-1072875797);
		public static HRESULT _NS_E_WINLIVE_HIP_SOLUTION_INVALID = new(-1072875796);
		public static HRESULT _NS_E_WINLIVE_PASSWORD_TOO_LONG = new(-1072875795);
		public static HRESULT _NS_E_WINLIVE_PASSWORD_TOO_SHORT = new(-1072875794);
		public static HRESULT _NS_E_WINLIVE_PASSWORD_INVALID = new(-1072875793);
		public static HRESULT _NS_E_WINLIVE_MEMBER_EXISTS = new(-1072875792);
		public static HRESULT _NS_E_WINLIVE_DOMAIN_IS_MANAGED = new(-1072875791);
		public static HRESULT _NS_E_WINLIVE_SECRET_QUESTION_TOO_SHORT = new(-1072875790);
		public static HRESULT _NS_E_WINLIVE_SECRET_QUESTION_TOO_LONG = new(-1072875789);
		public static HRESULT _NS_E_WINLIVE_SECRET_ANSWER_TOO_SHORT = new(-1072875788);
		public static HRESULT _NS_E_WINLIVE_SECRET_ANSWER_TOO_LONG = new(-1072875787);
		public static HRESULT _NS_E_WINLIVE_SECRET_QUESTION_CONTAINS_ANSWER = new(-1072875786);
		public static HRESULT _NS_E_WINLIVE_SECRET_ANSWER_CONTAINS_MEMBER_NAME = new(-1072875785);
		public static HRESULT _NS_E_WINLIVE_SECRET_ANSWER_CONTAINS_PASSWORD = new(-1072875784);
		public static HRESULT _NS_E_WINLIVE_SECRET_QUESTION_CONTAINS_PASSWORD = new(-1072875783);
		public static HRESULT _ZUNE_E_WINLIVE_UNAUTHORIZED_DOMAIN = new(-1056899039);
		public static HRESULT _ZEST_E_ACCOUNT_ZUNETAG_OCCUPIED = new(-1056857549);
		public static HRESULT _ZUNE_E_SIGNUP_INVALID_PARENT_EMAIL = new(-1056899047);
		public static HRESULT _ZUNE_E_SIGNUP_INVALID_PARENT_AGE = new(-1056899046);
		public static HRESULT _ZUNE_E_SIGNUP_PASSWORDS_DONT_MATCH = new(-1056899045);
		public static HRESULT _ZUNE_E_UPDATE_ACCOUNT_INFO_FAILED = new(-1056899040);
		public static HRESULT _ZEST_E_INVALID_POSTALCODE = new(-1056857603);
		public static HRESULT _ZEST_E_LIVEACCOUNT_INVALIDPHONE = new(-1056857601);
		public static HRESULT _ZEST_E_LIVEACCOUNT_ADDRESS_INVALID = new(-1056857537);
		public static HRESULT _ZEST_E_LIVEACCOUNT_PAYMENT_INSTRUMENT_INVALID = new(-1056857540);
		public static HRESULT _ZEST_E_CREDITCARD_ADDRESS_INVALID = new(-1056857570);
		public static HRESULT _ZEST_E_CREDITCARD_ADDRESS_STREET1_INVALID = new(-1056857568);
		public static HRESULT _ZEST_E_CREDITCARD_ADDRESS_CITY_INVALID = new(-1056857567);
		public static HRESULT _ZEST_E_CREDITCARD_ADDRESS_STATE_INVALID = new(-1056857566);
		public static HRESULT _ZEST_E_CREDITCARD_ADDRESS_POSTALCODE_INVALID = new(-1056857565);
		public static HRESULT _ZEST_E_CREDITCARD_PARENTPHONE_INVALID = new(-1056857564);
		public static HRESULT _ZEST_E_CREDITCARD_INVALID = new(-1056857563);
		public static HRESULT _ZEST_E_CREDITCARD_VALIDATE_FAILED = new(-1056857562);
		public static HRESULT _ZEST_E_CREDITCARD_ADD_FAILED = new(-1056857561);
		public static HRESULT _ZEST_E_INVALID_ARG_ZUNETAG = new(-1056858064);
		public static HRESULT _ZEST_E_INVALID_ARG_PARENT_PHONE_INVALID = new(-1056858078);
		public static HRESULT _ZEST_E_INVALID_ARG_CONTACT_INFO = new(-1056858076);
		public static HRESULT _ZEST_E_INVALID_ARG_LANGUAGE = new(-1056858057);
		public static HRESULT _ZEST_E_ZUNETAG_OFFENSIVE = new(-1056857522);
		public static HRESULT _ZUNE_E_PURCHASE_REQUIRES_AUTHORIZATION = new(-1056899019);
		public static HRESULT _ZEST_E_PARTNER_SERVICE_UNKNOWN_ERROR = new(-1056848896);
		public static HRESULT _NS_E_DRM_RENTAL_LICENSE_EXPIRED = new(-1072879537);
		public static HRESULT _NS_E_DRM_LICENSE_ALREADY_ACQUIRED = new(-1072879536);
		public static HRESULT _NS_E_DRM_DEVICE_RENTAL_LICENSE = new(-1072879535);
		public static HRESULT _ZUNE_E_CONTENT_NOT_SUPPORTED_ON_TUNER = new(-1056899034);
		public static HRESULT _ZUNE_E_QUICKMIX_MEDIA_NOT_FOUND = new(-1056898969);
		public static HRESULT _ZUNE_E_QUICKMIX_SESSION_IN_USE = new(-1056898964);
		public static HRESULT _ZUNE_E_UNKNOWN_REGION_OR_LANGUAGE = new(-1056899029);
		public static HRESULT _NS_E_CURL_INVALIDCHAR = new(-1072884955);
		public static HRESULT _NS_E_CURL_INVALIDPATH = new(-1072884953);
		public static HRESULT _ZUNE_E_ADD_REVIEW_FAILED = new(-1056898960);
		public static HRESULT _ZEST_E_MAX_CONCURRENTSTREAMING_EXCEEDED = new(-1056856102);
		public static HRESULT _ZEST_E_MULTITUNER_CONCURRENTSTREAMING_DETECTED = new(-1056856104);
		public static HRESULT _ZEST_E_MEDIAINSTANCE_STREAMING_OCCUPIED = new(-1056856095);

	}
}
