阅读:4059回复:3
驱动中不能 用二维数组吗?请大侠指教!
代码如下:
当在while循环中有 pstr[index][0] = (char*)ExAllocatePool(NonPagedPool() 类似时 ,就会出现如下错误 error LNK2019: unresolved external symbol __chkstk referenced in function "void __stdcall 如果把while注释掉!整个程序没有问题!请问为什么?我试过PAGED_LOOKASIDE_LIST 也同样存在这样的问题.. 如果我把char* ps = (char*)ExAllocatePool(NonPagedPool,这样也行!但是就是给pstr[index][0]这样的二维数组! 程序本身一个字符串辨识的作用! void SplistStr(char* pFileBuffer,int nFileLen) { char* pstr[100[10]; char* pMark = "#"; char* ptmpMark = ","; char* pTemp = NULL; char* ptmp = NULL; int index = 0; int nSpace = 0; int nLen = 0; int nsubLen = 0; if(pFileBuffer == NULL) return; for (int i=0;i<MAXROW;i++) { for (int j= 0;j<MAXCOL;j++) { pstr[j] = NULL; } } while ((pTemp = strstr(pFileBuffer + nSpace,pMark)) != NULL) { int nTemp = 0; int nsubIndex = 1; nLen = pTemp - pFileBuffer - nSpace ; // 当前的获取到的字符串长度 pstr[index][0] = (char*)ExAllocatePool(NonPagedPool,nLen +1);; memset(pstr[index][0],0,nLen +1); memcpy(pstr[index][0],pFileBuffer + nSpace,nLen); nSpace = nSpace + nLen + strlen(pMark); if(nSpace >= nFileLen) break; index++; } } |
|
沙发#
发布于:2010-12-01 01:54
Re:驅動中不能 用二維數組嗎?請大俠指教!
You defined this char* pstr[100][10] , and then you'd like to access pstr[index][0], are you kidding with me!!! take care for your pointer variable. |
|
板凳#
发布于:2010-12-31 16:46
用户被禁言,该主题自动屏蔽! |
|
地板#
发布于:2013-04-04 20:16
你的二维数组是char*的
换成等效指针就是char *** 你可以试试*(*(pstr+index)+0) = (char*)ExAllocatePool 还有 你的声明少了个] char* pstr[100[10]; 应是char* pstr[100][10]; |
|