コード例 #1
0
        public unsafe LoginOutput Login(LoginInput input)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            byte *pInput  = stackalloc byte[LoginInput.GetSize()];
            byte *pOutput = stackalloc byte[LoginOutput.GetSize()];

            input.WriteTo(pInput);
            int         result = UnsafeNativeMethods.rushquant_trade_Login(this._accountId, pInput, pOutput);
            LoginOutput output = new LoginOutput();

            output.ReadFrom(pOutput);
            if (result != ErrorCode.Success)
            {
                throw new RushQuantClientException(result, output.ErrorMessage);
            }

            return(output);
        }