亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dnw.cpp.bak

?? DNW0-50A,USB下載專用的
?? BAK
?? 第 1 頁 / 共 2 頁
字號:
#define STRICT
#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <tchar.h>
#include <string.h>
#include <process.h>
#include <stdlib.h>

#include "resource.h"

#include "def.h"
#include "dnw.h"
#include "engine.h"
#include "fileopen.h"
#include "d_box.h"
#include "usbtxrx.h"

//NOTE: _beginthread() 
// To use _beginenthread(),Activate "Project/Settings/C/C++/Categry/Code generation/
// Use Run-Time library/Multithreaded or Debug Multithreaded"

// If DDK2000 is used,
// 1. Project_Settings/CC++/Preprocessor/Additional_include_directories = C:\NTDDK\inc
// 2. Project_Settings/Link/Input/Additional_library_path=c:\NTDDK\libfre\i386

// If DDKXP is used,
// 1. Project_Settings/CC++/Preprocessor/Additional include directories = C:\WINDDK\2600\inc\w2k
// 2-1. Project_Settings/Link/Input/Additional_library_path=C:\WINDDK\2600\lib\w2k\i386
//      This causes some warning about '.rdata' section attribute.
// 2-2. Project_Settings/Link/Input/Additional_library_path==C:\WINDDK\2600\lib\i386\free
//      There's no warning.

/*
===================== REVISON HISTORY =====================
1. 2000. 3.30: V0.01 
  First release of DNW
2. 2000.10.11: V0.2
  The edit control is used for scroll, copy&paste, smooth screen update
3. 2001.1.26: V0.3
  a) The CPU usage will be less. Sleep() is inserted during TX.
  b) The filesize and checksum are transmitted together with bin file.
  c) WriteCommBlock() bug is fixed. The txEmpty flag should be changed in only DoRxTx().
4. 2001.2.24: V0.31
  a) The size of edit buffer is changed by EM_LIMITTEXT message.
     EDIT_BUF_SIZE(30000) -> MAX_EDIT_BUF_SIZE(65000)
  b) If the edit box is greater than 50000,
     the size of edit box is reduced by 10000.
  c) The horizontal scroll bar is removed for better look. 
  d) In WaitCommEvent() loop, 
     the following condition is inserted to clear the overrun condition.
    	if((dwEvtMask & EV_ERR){...}
  e) EB_Printf() have some error to process large string data.
5. 2001.3.8: V0.32
  a) EDIT_BUF_SIZE is reduced 25000 because the EM_REPLACESEL message is done very slowly
     if the size is over about 30000.
6. 2001.4.11: V0.32A
  a) Experimentally, MAX_EDIT_BUF_SIZE is set to the default value(32767). 
     //SendMessage(_hwndEdit, EM_SETLIMITTEXT, MAX_EDIT_BUF_SIZE, 0L);
     RESULT: MAX_EDIT_BUF_SIZE doesn't affect the display delay problem.
             I think that the new method for deleting the contents should be applied
	     Let's do tonight
7. 2001.5.14: V0.34
   a) I have known that the edit control isn't adequate for console program.
      So, I would give up the development of DNW using the edit control
      The last decision is as follows;
      MAX_EDIT_BUF_SIZE (65000) //up to 65535
      EDIT_BUF_SIZE (30000)   
      EDIT_BUF_DEC_SIZE (10000)
   b) If the selected text is deleted, the edit control displays the first of the text.
      In this case, to show the end of the text, dummy REPLACE_SEL is added.

8. 2001.11.23: V0.4
   a) USB download function is added.
   b) GetOverlappedResult() is used in TxFile() in order to save the cpu time more efficiently 
   c) Serial Configuration dialog box
   d) In secbulk.sys is changed to support IRP_MN_QUERY_CAPABILITIES.
      So, the surpriseRemoval is allowed. When the USB is yanked impolitely, 
      the warning dialog box won't appear in WIN2000.

9. 2001.11.24: v0.41alpha
   a) WriteFile() supports overlapped I/O to check broken pipe.
   b) progress bar is added for transmit operation.
   c) USB,serial status is printed on the window title bar
   
10. 2001.12.5: v0.42a
   a) In secbulk.sys, the maximum number of bulk packit in 1ms frame duration is changed to 16 from 4.
      So, transfer rate is increased from 220KB/S to 405KB/S 
   b) Although the fileopen was failed(or canceled), the transmit wasn't canceled. This is fixed.      
   c) When the options menu is selected, a serial port will be reconnected.
   d) The receive test menu is added. 

11. 2001.12.6: v0.43
   a) Fou USB tx operation, TX_SIZE is increased from 2KB to 16KB.
      So, transfer rate is increased from 405KB/S to 490KB/S.
      (2KB:405KB/S 4KB:450KB/S  8KB:470KB/S 16KB:490KB/S)

12. 2001.12.7: v0.44b
   a) Although a serial port is not connected, the serial port is connected 
      after Configuration/Options menu -> fixed.
   b) The name dnw.cfg for v 0.4x is changed to dnw.ini 
      in order not to confuse old dnw.cfg for ver 0.3x
      
12. 2002.01.2: v0.44c
   a) The edit box size is changed to display 80x25 characters 
      
13. 2002.02.22: v0.45
   a) In windows95, DNW doesn't search USB stack.
   b) When download, there should be a cancel button
   c) Sometimes, the progress bar is not filled although download is doing.
      I think it's because InitDownloadProgress() is executed 
      before than DownloadProgressProc().
      So, I inserted the code to wait until DownloadProgressProc() is executed as follows;
	  while(_hDlgDownloadProgress==0); //wait until the progress dialog box is ready.
   d) secbulk is optimized 
14. 2002.04.01: v0.46
   a) If DNW is start to transmit although the b/d is not ready, DNW will be hung.
      It's only solution to turn off and on the b/d.
      To solve this problem smoothly, the overlapped I/O will be used for USB transfer. 
      But, secbulk.sys may not support overlapped I/O. 
      Although I implemented the overlapped I/O, WriteFile() function didn't return before its completion.
   b) Because the overlapped I/O doens't work as my wish,
      and in order to quit the dnw.exe hung, modaless dialogue box is used for the progress bar.
   c) *.nb0

  15. 2002.04.10: v0.47
   a) I reduce the edit box size as follows;  
	#define MAX_EDIT_BUF_SIZE (0x7FFE) 
	#define EDIT_BUF_SIZE (0x6000)   
	#define EDIT_BUF_DEC_SIZE (0x1000)
      There is no good cause about why I change. I want to just reduce the edit box size.
   b) Sometimes, when transmit, there is no transmit although the transmit progrss dialog box is shown.
      I think that it's because the _enthread() fails.
      To debug this problem, the _enthread result is checked.

  16. 2002.04.19: v0.48
   a) The bug of WIN2K WINAPI is found. ->It's not fixed perfectly.
      Please let me know of the solution to avoid the memory problem of SetWindowText() API.

      The SetWindowText()(also,WM_SETTEXT message) consumes 4KB system memory every times.
      I think there is some bug in SetWindowText API.
      In my case, because SetWindowText() is called every 1 seconds, 
      the system memory used by DNW.exe is increased by 4KB every 1 seconds.
      For emergency fix, SetWindowText() will be called only when its content is changed.
      
      NOTE. This memory problem is not memory leakage problem 
            because the memory is flushed when the window is shrinked.

  17. 2002.05.03:v0.49
   a) Sometimes, when transmit, there is no transmit although the transmit progrss dialog box is shown.
      I have found the cause.
      It's because _hDlgDownloadProgress.
      If the TxFile thread is executed first than WM_INITDIALOG message,
      while(_hDlgDownloadProgress==NULL); will not exited because _hDlgDownloadProgress 
      in CPU register will be checked. So, the volatile should have been used 
      because _hDlgDownloadProgress value is changed in another thread.
      The solution is as follows;
      volatile HWND _hDlgDownloadProgress=NULL;
   b) Sometimes, the CPU usage will be always 100% if dnw.exe is being executed.
      This is because of the just above problem.
      If the problem 17-a) is occurred, the TxFile will be an obsolete thread.
      while(_hDlgDownloadProgress==NULL); will use the CPU at 100%.
      I think that this problem may be cleared because the problem 17-a) is cleared.
   c) The small icon,DNW is displayed in the window shell task bar and the window title.

  18. 2003.04.25:v0.50
   a) In case that a USB2Serial cable is used when COMPAQ Presario 1700, 
      a few last character display is postponed until the next group is received.
      -> MSDN recommends the while() for read operation, which has solved the problem.
   b) In DoRxTx(), the EV_ERR is added to SetCommMask(); -> which is more correct, I think.
   c) For overlapped WaitCommEvent,ReadFile,WriteFile, the return value should be checked.
      For ReadFile,WriteFile cases, the operation has no change.
      In previous version(V0.49), WaitCommEvent(,,NULL) should have not been used because OVERLAPPED I/O was being used.
      The combination of WaitCommEvent(,,&os) and GetOverlappedResult() will fix this problem.
   d) During developing the DNW v0.50, I had experienced some blue screen without any USB connection when I reset the SMDK2410.
      This problem was occurred when WaitCommEvent(,,&os) without GetOverlappedResult().
      This problem was not revived when is WaitCommEvent(,,NULL) although it's not correct. 
      
      From this phenomenon, I assume that the blue-screen, which is caused sometimes when resetting the SMDK2410, 
      may be caused by the mis-use of WaitCommEvent(,,NULL).

      But, it's still truth that the abnormal USBD response may cause the windows blue-screen
      ,which I experienced many times during my secbulk.sys development.
   
   19. 2003.04.29:v0.50A
   a) If the break condition is detected, "[DBG:EV_ERR]" message is displayed.
      So, the display of "[DBG:EV_ERR]" is removed.
*/

/*   
Items to be enhanced.
   - avoid SetWindowText() API problem.
   - remove debug stuff in following functions.
         void InitDownloadProgress(void);   
	 void DisplayDownloadProgress(int percent);
   - make status bar.
   - malloc() uses too much memory for large file transfer.
   - Enlarge the scroll buffer -> the edit box is not adequate.
   - file logging function
   - Ctrl+C should be work as copy function.
*/ 

/*
Edit Box Note:
- Check if the edit box is scrolled to show the text being deleted
  when the selected text is deleted in Win2000. In windows98, It's scrolled to show the deleted portion unfortunately.
*/

#define IS_OVERLAPPED_IO    (TRUE)

int userBaudRate,idBaudRate;
int userComPort;

#define MAX_BLOCK_SIZE (4096)

HANDLE idComDev;
OVERLAPPED osWrite,osRead;
volatile int isConnected=FALSE;
TCHAR rxBuf[MAX_BLOCK_SIZE+1];
volatile char *txBuf;
volatile DWORD iTxBuf;
DWORD txBufSize;

volatile int txEmpty=TRUE;



void MenuAbout(HWND hwnd)
{
    MessageBox(hwnd,TEXT("Serial Console with Serial/USB Download\n\n")
		    TEXT("1. e-mail: purnnamu@sec.samsung.com\n")
	  	    TEXT("2. USB Tx format: addr(4)+size(4)+data(n)+cs(2)   \n")
		    TEXT("3. Serial Tx format: size(4)+data(n)+cs(2)\n"),
	   	    TEXT("About ")APPNAME,MB_OK | MB_ICONINFORMATION );
}





void Quit(HWND hwnd)
{
    CloseComPort();
}



void MenuConnect(HWND hwnd)
{
    if(isConnected==TRUE)
    {
	CloseComPort();
    }

    OpenComPort(userComPort);
}



void UpdateWindowTitle(void)
{
    TCHAR title[256];
    TCHAR tch[16];
    
    static int prevComPort=0xff;
    static int prevBaudRate=0xff;
    static int prevUsbAlive=0xff;
    static int prevIsConnected=0xff;
    int usbAlive;

    lstrcpy(title,APPNAME);
    lstrcat(title,TEXT("   [COM"));

    if(isConnected==TRUE) //serial O.K.
    {
	tch[0]='0'+userComPort;
	tch[1]='\0';
	lstrcat(title,tch);
	lstrcat(title,TEXT(","));
	lstrcat(title,_itot(userBaudRate,tch,10) );   //_itot :TCHAR version of itoa 
	lstrcat(title,TEXT("bps]"));
    }
    else
    {
	lstrcat(title,TEXT(":x]"));
    }

    
    if(IsUsbConnected())
    {
	lstrcat(title,TEXT("[USB:OK]"));
	usbAlive=1;
    }
    else
    {
	lstrcat(title,TEXT("[USB:x]"));
	usbAlive=0;
    }

    //The bug of WIN2K WINAPI is found.
    //The SetWindowText()(also,WM_SETTEXT message) consumes 4KB system memory every times.
    //I think there is some bug in SetWindowText API.
    //In my case, because SetWindowText() is called every 1 seconds, 
    //the system memory used by DNW.exe is increased by 4KB every 1 seconds.
    //For emergency fix, SetWindowText will called only when its content is changed.
    //NOTE. This memory leakage is flushed when window is shrinked.

    if(userComPort!=prevComPort || userBaudRate!=prevBaudRate || usbAlive!=prevUsbAlive ||
       isConnected!=prevIsConnected )
    {
	SetWindowText(_hwnd,title);
    }
    prevComPort=userComPort;
    prevBaudRate=userBaudRate;
    prevUsbAlive=usbAlive;
    prevIsConnected=isConnected;
}



void MenuTransmit(HWND hwnd)
{
    HANDLE hFile;
    DWORD fileSize;
    unsigned short cs=0;
    DWORD i;
    BOOL result;
    unsigned long threadResult;

    if(!isConnected)
    {
	EB_Printf(TEXT("[ERROR:Not Connected]\n"));
	return;
    }
    result=PopFileOpenDlg(hwnd,szFileName,szTitleName);
    
    if(result==0) //file open fail
    {
	return;
    }

    hFile=CreateFile(szFileName,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);

    if(hFile==INVALID_HANDLE_VALUE)
    {
	EB_Printf(TEXT("[ERROR:File Open]\n") );
	return;
    }
    
    fileSize=GetFileSize(hFile,NULL);

    txBuf=(char *)malloc(fileSize+6);
    if(txBuf==0)
    {
	EB_Printf(TEXT("[ERROR:Memory Allocation Fail:(%d)]\n"),fileSize+6 );
	return;
    }

    ReadFile(hFile,(void *)(txBuf+4),fileSize,&txBufSize,NULL);
    if(txBufSize!=fileSize)    
    {
    	EB_Printf(TEXT("[ERROR:File Size Error]\n") );
	return;
    }

    *((DWORD *)txBuf)=fileSize+6;   //attach filesize(n+6) 

    for(i=4;i<(fileSize+4);i++)
	cs+=(BYTE)(txBuf[i]);
    *((WORD *)(txBuf+4+fileSize))=cs;   //attach checksum 
    
    txBufSize+=6;
    iTxBuf=0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国v精品久久久网| 99久久国产综合精品女不卡| 成人午夜视频福利| 欧美二区在线观看| 国产精品网站在线播放| 久久99精品久久久| 欧美日韩在线观看一区二区 | 国产高清视频一区| 欧洲一区二区三区免费视频| 国产欧美综合在线观看第十页| 午夜视频一区二区三区| 色综合欧美在线视频区| 精品欧美一区二区三区精品久久| 亚洲一线二线三线久久久| 国产成人av电影在线观看| 日韩欧美国产成人一区二区| 午夜久久福利影院| 在线观看日韩av先锋影音电影院| 中文字幕视频一区二区三区久| 经典三级一区二区| 日韩欧美亚洲另类制服综合在线| 亚洲香肠在线观看| 色噜噜夜夜夜综合网| 国产精品人妖ts系列视频| 懂色av中文字幕一区二区三区| 久久先锋影音av鲁色资源网| 蜜臀久久99精品久久久久久9 | 国产日韩精品一区二区浪潮av | 婷婷一区二区三区| 欧美电影一区二区| 天天综合网 天天综合色| 欧美视频在线观看一区二区| 亚洲夂夂婷婷色拍ww47| 欧美中文字幕一区二区三区亚洲| 一区二区三区在线观看欧美| 99r国产精品| 亚洲激情自拍偷拍| 欧美性受xxxx| 性感美女极品91精品| 欧美嫩在线观看| 美日韩黄色大片| 久久精品一区八戒影视| 懂色一区二区三区免费观看| 亚洲欧美综合另类在线卡通| 色先锋资源久久综合| 亚洲一卡二卡三卡四卡| 欧美精品一二三| 美女视频一区在线观看| 国产欧美久久久精品影院| 99精品偷自拍| 午夜私人影院久久久久| 欧美一区二区三区免费视频| 国内精品伊人久久久久影院对白| 久久免费视频色| 91啪在线观看| 午夜国产精品一区| 久久久777精品电影网影网| 成人午夜精品一区二区三区| 亚洲一区在线观看视频| 欧美日本免费一区二区三区| 久久精品国产精品亚洲红杏| 日本一区二区成人在线| 色88888久久久久久影院野外| 日韩在线卡一卡二| 久久久久国产精品麻豆ai换脸| 成人高清免费观看| 亚洲国产成人高清精品| 久久亚洲精精品中文字幕早川悠里 | 中文字幕制服丝袜一区二区三区 | 欧美日韩一区二区欧美激情| 美腿丝袜亚洲色图| 欧美韩日一区二区三区四区| 91麻豆精东视频| 奇米精品一区二区三区四区 | 欧美一级久久久| 成人高清在线视频| 日本vs亚洲vs韩国一区三区二区| 国产精品久久久久久久浪潮网站| 欧美视频第二页| 国产成人免费视频网站高清观看视频 | 中文字幕成人在线观看| 91亚洲精品乱码久久久久久蜜桃| 韩国精品在线观看| 中文字幕视频一区二区三区久| 日韩一区二区三区视频在线| 成人动漫视频在线| 韩国v欧美v亚洲v日本v| 亚洲成人综合在线| 日韩美女啊v在线免费观看| 日韩欧美的一区| 欧美日本精品一区二区三区| 国产高清不卡二三区| 全部av―极品视觉盛宴亚洲| 18成人在线观看| 国产日产欧美一区二区三区| 欧美一级黄色录像| 欧美肥大bbwbbw高潮| 91福利资源站| 国产色婷婷亚洲99精品小说| 欧美日韩中文国产| 成人丝袜视频网| 青青青伊人色综合久久| 亚洲国产日韩综合久久精品| 国产精品高潮呻吟| 国产欧美精品一区二区色综合| 亚洲成av人**亚洲成av**| 亚洲综合成人网| 日韩欧美亚洲国产精品字幕久久久| 中文字幕不卡的av| 日韩欧美一区二区三区在线| 欧美无人高清视频在线观看| 色综合av在线| 91麻豆高清视频| 不卡一区二区中文字幕| 国产成人综合亚洲91猫咪| 国产一区二区在线观看免费 | 99久久精品免费| 99久久婷婷国产综合精品| 成人短视频下载| 91在线观看美女| 欧美亚洲图片小说| 欧美三区免费完整视频在线观看| 色吊一区二区三区| 欧美人伦禁忌dvd放荡欲情| 欧美二区三区的天堂| 制服丝袜一区二区三区| 欧美一级欧美三级在线观看| 欧美电视剧免费全集观看| 2023国产一二三区日本精品2022| 精品久久久久久久久久久久包黑料 | 亚洲视频香蕉人妖| 亚洲伦理在线精品| 亚洲一区免费观看| 日本va欧美va瓶| 国产一区二区福利| 成人av网站免费| 91九色02白丝porn| 欧美一级日韩免费不卡| 久久亚洲一级片| 亚洲六月丁香色婷婷综合久久| 午夜国产精品一区| 国产一区二区在线视频| 99re热这里只有精品免费视频| 精品污污网站免费看| 日韩精品中文字幕一区二区三区| 亚洲国产成人私人影院tom| 亚洲激情在线激情| 久久精品国产久精国产爱| 波多野结衣精品在线| 欧美日韩精品二区第二页| 日韩精品中文字幕在线不卡尤物| 国产精品国产馆在线真实露脸| 亚洲高清在线精品| 国产精品影视网| 欧美午夜电影一区| 久久久久国产免费免费| 亚洲电影一区二区| 国产jizzjizz一区二区| 欧美日韩mp4| 国产精品卡一卡二| 欧美96一区二区免费视频| 成人免费视频国产在线观看| 欧美日韩国产一区二区三区地区| 久久欧美一区二区| 日日欢夜夜爽一区| 99精品久久免费看蜜臀剧情介绍| 91精品免费在线观看| 亚洲欧美日韩国产综合| 久久国产精品第一页| 欧美性三三影院| 中文字幕亚洲精品在线观看| 久久精品国产99国产| 欧美亚州韩日在线看免费版国语版| 久久久久久久久久久久久女国产乱| 午夜婷婷国产麻豆精品| 91日韩精品一区| 国产精品卡一卡二| 国产一区二区三区免费播放| 欧美日韩精品欧美日韩精品一| 中文字幕亚洲精品在线观看| 国产成人在线视频网址| 制服丝袜av成人在线看| 亚洲线精品一区二区三区八戒| 成人免费的视频| 国产无人区一区二区三区| 六月丁香综合在线视频| 欧美日产在线观看| 亚洲大片一区二区三区| 色狠狠一区二区三区香蕉| 国产精品区一区二区三区| 国产精品中文字幕日韩精品| 精品国产伦一区二区三区免费| 亚洲福利视频一区| 色婷婷综合久久久久中文一区二区| 国产精品久久久久9999吃药| 国产麻豆精品视频| 久久亚洲精品国产精品紫薇| 九九**精品视频免费播放| 91精品国产综合久久久久久久| 亚洲成人激情综合网|