hi everyone, i bought serial programmer expecting to use it without hard times. The brand is SOFI SP8-B a chiness programmer. i just need ur help to write serial numbers after programming an EEPROM chip (w25q16cvsig). i am sending sample file for the serialization may be one of u guys can help, thanks.
the are the source code.




// SampleSN.cpp : 定义 DLL 应用程序的入口点。
//

#include "stdafx.h"
#include "stdio.h"

1 BOOL APIENTRY DllMain( HANDLE hModule,
2 DWORD ul_reason_for_call,
3 LPVOID lpReserved
4 )
5 {
6 return TRUE;
7 }


8 const char AUTOSN_DISC[] = "This is a sample.";


/************************************************** **************************************************
** DLL库描述 **
** 最大允许128个字符 **
************************************************** **************************************************/
9 extern "C" __declspec(dllexport) void GetDescription(char * ptext)
10 {
11 strcpy(ptext, AUTOSN_DISC);
12 }


/************************************************** **************************************************
** 自动序列号更新函数 **
** **
** 传入参数: pBuf - 芯片数据缓冲区指针(不允许超出芯片的容量范围) **
** pMsg - 回传描述信息, 最多64个英文字符(32个中文字) **
** 每执行一次芯片烧录后, 此信息将自动显示在操作信息窗内 ** **
************************************************** **************************************************/
13 extern "C" __declspec(dllexport) void UpdateSN(BYTE * pBuf, char * pMsg)
14 {
15 DWORD dwCount;
16
17 dwCount = pBuf[0];
18 dwCount |= pBuf[1] << 8;
19 dwCount |= pBuf[2] << 16;
20 dwCount |= pBuf[3] << 24;
21
22 dwCount++;
23
24 pBuf[0] = (BYTE)(dwCount & 0xff);
25 pBuf[1] = (BYTE)(dwCount >> 8);
26 pBuf[2] = (BYTE)(dwCount >> 16);
27 pBuf[3] = (BYTE)(dwCount >> 24);
28
29 sprintf(pMsg, "[SampleSN.DLL]序列号更新为: %8.8X", dwCount);
30 }