檔案過濾驅動的開發 上

2021-03-31 08:56:30 字數 1078 閱讀 4763

當下列情況之一發生時,waitformultipleobjects函式返回

1.乙個或者全部指定的物件在訊號狀態(signaled state)

2.到達超時間隔

**如下:

dword dwwaitstatus;                       

handle dwchangehandles[2];

//監視c:/windows目錄下的檔案建立和刪除

dwchangehandles[0] = findfirstchangenotification(

"c://windows",                 // directory to watch

false,                         // do not watch the subtree

file_notify_change_file_name); // watch file name changes

if (dwchangehandles[0] == invalid_handle_value)

exitprocess(getlasterror());

//監視c:/下子目錄樹的檔案建立和刪除

dwchangehandles[1] = findfirstchangenotification(

"c://",                        // directory to watch

true,                          // watch the subtree

file_notify_change_dir_name);  // watch dir. name changes

if (dwchangehandles[1] == invalid_handle_value)

exitprocess(getlasterror());

// change notification is set. now wait on both notification

// handles and refresh accordingly.

while (1) }

我的TDD實踐 可測試性驅動開發(上)

tdd 測試驅動開發,test driven development 是重要的敏捷實踐之一,它的基本原理是用測試來帶動開發,先寫測試 再寫開發 最後重構。許多tdd推廣和實踐者認為,這種方式易於帶來高質量的 而如今,tdd也慢慢有了test driven design,也就是測試驅動設計的意味。也就...

基於檔案過濾驅動的檔案重定向

ntstatus sfcreate in pdevice object deviceobject,in pirp irp assert is my device object deviceobject deviceextension deviceobject deviceextension atta...

基於檔案過濾驅動的檔案重定向

ntstatus sfcreate in pdevice object deviceobject,in pirp irp assert is my device object deviceobject deviceextension deviceobject deviceextension atta...