以下代码出现了错误,出现错误,
HWND hDestTop; 
    hDestTop = ::FindWindow("progman", NULL); 
    hDestTop = ::FindWindowEx(hDestTop, 0, "shelldll_defview", NULL); 
    hDestTop = ::FindWindowEx(hDestTop, 0, "syslistview32", NULL); 
    
    int count=(int)::SendMessage( hDestTop, LVM_GETITEMCOUNT, 0, 0);     LVITEM lvi, *_lvi; 
    char *_item, item[512]; 
    int  *_iImage, iImage ; 
    unsigned long pid; 
    HANDLE process; 
    
    GetWindowThreadProcessId( hDestTop, &pid); 
    process=OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, pid); 
    
    _lvi = (LVITEM*)VirtualAllocEx(process, NULL, sizeof(LVITEM), MEM_COMMIT, PAGE_READWRITE); 
    _item = (char*)VirtualAllocEx(process, NULL, 512, MEM_COMMIT, PAGE_READWRITE); 
    _iImage = (int*)VirtualAllocEx(process, NULL, sizeof(int), MEM_COMMIT, PAGE_READWRITE);     lvi.cchTextMax=512; MEMORY_BASIC_INFORMATION *pstructd;
    PVOID BaseAddress;       PVOID AllocationBase;    DWORD AllocationProtect;    DWORD RegionSize;    DWORD State;    DWORD Protect;    DWORD Type; DWORD dwLength;
 DWORD DD;
VirtualQueryEx(process,_lvi,pstructd,dwLength); //这里
AllocationBase=pstructd->AllocationBase;//这里
VirtualProtectEx(process,AllocationBase,dwLength,PAGE_READWRITE,&DD);
//程序由于并不能写入虚拟内存,所以得不出桌面图标项,所以我想改变读写属性,但出错了,不明为什么?
//BaseAddress=structd.AllocationBase;
    for( int i=0; i < count; i++) 
{         lvi.iSubItem=0; 
        lvi.pszText=_item;       int a=  WriteProcessMemory(process, _lvi, &lvi, sizeof(LVITEM), NULL); 
      //  WriteProcessMemory(process, _lvi, &lvi, sizeof(LVITEM), NULL);      int b=    ::SendMessage( hDestTop, LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)_lvi);    
::SendMessage( hDestTop, LVM_GETIMAGELIST, (WPARAM)i, (LPARAM)_lvi);      int c=   ReadProcessMemory(process, _item, item, 512, NULL); 
        ReadProcessMemory(process, _iImage, &iImage, sizeof(iImage), NULL);         CString str; 
        str.Format(" %s  ----> %d\n", item, iImage); 
        AfxMessageBox( str ); 
    } 
    
    VirtualFreeEx(process, _lvi, 0, MEM_RELEASE); 
    VirtualFreeEx(process, _item, 0, MEM_RELEASE);     CloseHandle( process );