0

Why am I get this crazy high value in the field member of LPWFSIDCSTATUS? Does this mean that the ATM does not have an anti-fraud module? Am I missing anything?

Field values such as fwDevice or fwMedia produce the correct values, so I'm not sure why wAntiFraudModule or wDevicePosition is behaving this way.

Using visual studio debugger

Here's a code segment of what I've got going on.

LPWFSRESULT lpResult = NULL;
LPWFSPTRSTATUS lpStatus = NULL;
HRESULT result = WFMAllocateBuffer(sizeof(WFSPTRSTATUS), WFS_MEM_ZEROINIT | WFS_MEM_SHARE, (void**)&lpResult);
if (result != WFS_SUCCESS)
    std::cout << "FAILED TO ALLOCATE\n";
dev_status = WFSGetInfo(XFS::GetServiceInstance(), WFS_INF_PTR_STATUS, NULL, 40000, &lpResult);
if (dev_status != WFS_SUCCESS)
    std::cout << "Failed to get status for printer\n";
lpStatus = (LPWFSPTRSTATUS)lpResult->lpBuffer;
WORD my_fraud = lpStatus->wAntiFraudModule;
std::cout << "Anti-Fraud status: " << my_fraud << std::endl;
WFSFreeResult(lpResult);

  • Perhaps the reason for this is because the vendor didn't implement this in their SPI? – ManWithTheQuestions Apr 29 '21 at 15:17
  • It is possible that you are using a xfsptr.h of 3.20 version or higher to compile but when you open the SPI you select lower version? The SPI sets a less info struct without this parameter, so it finaly has a undefined value, and probably you are reading out of your memory. – SuperG280 May 05 '21 at 12:52
  • And other thing: you musn't allocate memory for lpResult. You only need to define the lpStatus pointer set it to null and pass its memory address (double pointer) to WFSGetInfo. The SPI will allocate memory for the WFSRESULT struct. Because of this, you need to call WFSFreeResult. – SuperG280 May 05 '21 at 15:23
  • @SuperG280 Okay so I was using the SPI version `0x0B020003` which according to the documentation supports (2.11 to 3.00). I'm having trouble finding an SPI version for 3.30. Any idea where it is? – ManWithTheQuestions May 06 '21 at 14:29
  • So you can't use the interfaze you are using. This variables were added in 3.20 specifcation version. If your SPI only support from 2.11 to 3.00, you need to download the 3.00 XFS SDK to compile your application. The SPI is developed by a vendor (NCR, Diebold, GRG, etc..) You need to ask the vendor for a new version if it is needed in your development. – SuperG280 May 06 '21 at 14:33
  • @SuperG280 This may be a silly question, but do you know where I can check the SPI version without consulting with the vendor (they take too long to answer questions)? Would I find it in the registry? – ManWithTheQuestions May 06 '21 at 14:47
  • When you executes `WFSOpen`, you ask for a SPI version (because you have developed using a specific XFS api version), using `dwSrvcVersionsRequired` for a `lpszLogicalName`. The SPI returns versions supported in `lpSPIVersion`. All is documented in `WFSOpen` function documentation. If the version asked is supported, WFSOpen works, if not, it returns version error. – SuperG280 May 06 '21 at 14:53

0 Answers0