Beispiel #1
0
        protected ErrorCode CreateHandle()
        {
            Debug.Assert(_handle == IntPtr.Zero);

            var errorCode = OfficialApi.CreateHandle(ref _handle, ref _deviceInformation);

            if (errorCode != ErrorCode.MV_OK)
            {
                this.ErrorFailWithReason(errorCode);
            }
            else
            {
                Debug.Assert(_handle != IntPtr.Zero);

                this.InfoSuccess();
            }
            return(errorCode);
        }