0

i'm build apps using CEN XFS Standard, then i got this error WFS_ERR_INVALID_POINTER in CEN XFS document it was meaning like this A pointer parameter does not point to accessible memory. but i dont know what this error,,

my WFSExecute like this :

WFSExecute(lphService, 1401, cardDispense, 0, lppResult);

and my lppResult like this :

    [StructLayout(LayoutKind.Explicit), Serializable]
    public struct WFSResult
    {
        [FieldOffset(0), MarshalAs(UnmanagedType.U4)]
        public uint RequestID;

        [FieldOffset(4), MarshalAs(UnmanagedType.U2)]
        public ushort hService;

        [FieldOffset(6), MarshalAs(UnmanagedType.Struct, SizeConst = 16)]
        public Timestamp tsTimestamp;

        [FieldOffset(22), MarshalAs(UnmanagedType.U4)]
        public int hResult;

        [FieldOffset(26), MarshalAs(UnmanagedType.U4)]
        public UInt32 dwCommandCode;

        [FieldOffset(26), MarshalAs(UnmanagedType.U4)]
        public UInt32 dwEventID;

        [FieldOffset(30), MarshalAs(UnmanagedType.U4)]
        public Int32 lpBuffer;
    }
Roman
  • 11,966
  • 10
  • 38
  • 47
Hakim
  • 1
  • 2
  • Please post an [mcve], even though we cannot really compile or test it it is important to see all the types involved. Right we'll have to guess what the signature of that WFSExecute method is, and the types of lphService, cardDispense, and lppResult, and how you arrived at the values for those parameters. – Lasse V. Karlsen May 23 '17 at 11:36
  • For starters, there is no visible pointer in the posted code, so it's all guess work. – Lasse V. Karlsen May 23 '17 at 11:36
  • Could it be `lpbuffer`? "lp" = long pointer? If so, how do you calculate that value from C#? Or will that be filled by the code you call? – Lasse V. Karlsen May 23 '17 at 11:37
  • lphService and cardDispense is just string, so i think is not effect with my error... – Hakim May 23 '17 at 11:56
  • lp is name from CEN XFS document so its no problem with that, my problem i think is with that structure.. – Hakim May 23 '17 at 11:57
  • @LasseV.Karlsen – Hakim May 23 '17 at 11:58
  • Can you post the type as it is declared in the CEN XFS documentation, or in its header files or wherever you have the real declaration of it? – Lasse V. Karlsen May 23 '17 at 11:58
  • sorry its my fault cz i'm not passing my param with pointer..so its error..ty – Hakim May 23 '17 at 15:53

0 Answers0